Nils Smeds <[log in to unmask]> wrote:
>Which makes the point I tried to make in the latest ACM Fortran Forum:
>
>- If it was allowed to USE the interface for the subroutine itself
>in the subroutine declaration.
>
>- And if the language incorporated that when the subroutine contains an
>interface to itself then the compiler must verify that the interface is
>correct with respect to the actual declared dummy arguments.
>
>- Then the circle would be closed and the interface would be forced to be
>coherent to the subroutine.
I was promoting this idea a couple of years ago (either here or
in the Fortran newsgroup). The response I got was that this was
too cumbersome, since it required you to make the declarations
of your procedure and its arguments in two different places.
And, it still wouldn't guarantee that the interface would be
properly checked - the programmer is merely on his honor
to actually USE the interface module anyway. The impression
I got was that this idea would never even be considered by
the committee.
I don't find either of the objections to the idea particularly
compelling. They *are* legitimate objections though. Suppose
you change the interface, but subsequently link to an old
version of the actual code. This will cause you to use the
program with a mismatched interface (unless you also have
a load-time test - but with such a thing you could get by
without interfaces entirely).
--
J. Giles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|