On Mon, 2012-07-30 at 17:03 -0500, Bill Long wrote:
> On 7/30/12 3:17 PM, Phillip Helbig wrote:
>
> > However, in this case why can't I USE other intrinsic procedures? Why
> > does using them on the module make them accessible to whatever USEs the
> > module?
> >
>
> Intrinsic procedures are always available in any scope unless the user
> has hijacked the name in that scope for something else, usually the name
> of his own external procedure that overrides the intrinsic. It really
> does not make sense to "use" an actual intrinsic. It would make sense
> to USE a user-written procedure that overrides the intrinsic. If I saw
> the name of an intrinsic in the ONLY clause of a USE statement, I would
> assume the module was providing access to one of these override procedures.
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).
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.
Should "intrinsic procedures" in list item (1) in subclause 16.3.1 in
the 2008 standard be "intrinsic procedures that are referenced or
declared"?
|