(j3.2006) Interface body question

dick.hendrickson at att.net dick.hendrickson
Sat Oct 24 11:42:17 EDT 2009


 
  -------------- Original message from Van Snyder <Van.Snyder at jpl.nasa.gov>: --------------


> [09-007r3:281:29-31 12.4.3.2p6] says
> 
>         An interface body specifies all of the characteristics of the
>         explicit specific interface or abstract interface. The
>         specifiation part of an interface body may specify attributes or
>         define values for data entities that do not determine
>         characteristics of the procedure. Such specifications have no
>         effect.
> 
> This has been around forever.

Or at least since the early 90s ;).
> 
> All the compilers I met rejected the following sort of thing
> 
>   interface
>     subroutine sub ( A )
>       real :: A
>       integer :: J, I(J)
>       character(*) :: C
>     end subroutine sub
>   end interface
> 
> because a statement is missing
>       parameter ( J=3, C="xyz" )
> 
> Must the declarations that have no effect satisfy the constraints that
> would be relevant if they were to have an effect?
> 
> -- 
> Van Snyder                    |  What fraction of Americans believe 
> Van.Snyder at jpl.nasa.gov       |  Wrestling is real and NASA is fake?
> Any alleged opinions are my own and have not been approved or
> disapproved by JPL, CalTech, NASA, the President, or anybody else.
> 
> _______________________________________________
> J3 mailing list
> J3 at j3-fortran.org
> http://j3-fortran.org/mailman/listinfo/j3

There was a similar question about INTENT(IN) also in the early 90s.  Given
      INTENT(IN)  X
is something like
      IF (.FALSE.) X = 0
standard conforming?  The answer was NO, and I think words were changed from something like "intent(in) objects must not become defined" to "intent(in) objects must not appear in a definition context."

As I recall, there was some worry about distinguishing between compile time and run time issues, without actually mentioning compile time or run time.  We didn't want to disallow something like
      IF (X .GT. 0.0)  y = sqrt(x)
and not encourage stupidities like
      IF (X .GT. 0.0) y = sqrt (-1.0)

That might be why the words aren't clear.

Dick Hendrickson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://j3-fortran.org/pipermail/j3/attachments/20091024/bd43120f/attachment.htm>



More information about the J3 mailing list