> Philip's question was why INTEGER :: I = RADIX(1) makes RADIX available
> for USE association, but, say, SQRT is not available for USE association
> (unless it's referenced, or declared by an INTRINSIC statement).
Right.
> This is a gray area that isn't covered by the standard, as far as I can
> find. Referencing RADIX, or indeed any inquiry function, in a constant
> specification expression isn't a declaration.
Right.
> Should "intrinsic procedures" in list item (1) in subclause 16.3.1 in
> the 2008 standard be "intrinsic procedures that are referenced or
> declared"?
Probably. Since intrinsic procedures have an explicit interface,
IMPLICIT NONE doesn't matter. However, if it is not mentioned in the
module, is it the intrinsic procedure or an implicitly declared
variable? Only by mentioning it is it clear that it is the procedure.
In other words, if there is no IMPLICIT NONE in the module which could
mention the procedure, it is not clear if the procedure or an implicitly
declared variable is to be USEd. If IMPLICIT NONE is mentioned, then it
has to be something explicitly declared.
I found this only via a typo. I was surprised that it worked, and even
more surprised that most compilers treat it the way mine does. After
some remarks from Richard Maine in comp.lang.fortran, I think I now
understand it. However, some other people were surprised as well and as
the example above shows, some compilers do think differently.
|