>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).
All the public entities of the module are available for USE.
Entities that don't even exist, don't even exist. SQRT does not appear in the
module so is not an entity of the module.
>This is a gray area that isn't covered by the standard, as far as I can
>find.
I do not agree.
> Referencing RADIX, or indeed any inquiry function, in a constant
>specification expression isn't a declaration.
Yes it is. Referencing any identifier as a procedure, in a specification
expression or elsewhere, declares that identifier to be the identifier of a
procedure. Together with the other rules in the standard, that makes RADIX an
intrinsic procedure in this case.
(The distinction between declaration and specification can be quite subtle!
Really, any appearance of an identifier that conveys information about that
identifier is a declaration. If I write "X = 3", that is an implicit
declaration that X is a variable. If X is not already known about, it is
usually also a declaration that X is default real.)
>Should "intrinsic procedures" in list item (1) in subclause 16.3.1 in
>the 2008 standard be "intrinsic procedures that are referenced or
>declared"?
No.
When Bill says "Intrinsic procedures are always available in any scope
[unless...]", he does not mean that they exist in every scope. They will only
exist if they have been brought into existence by some means. The same goes for
user-defined variables and procedures.
After all, one could say "The name fred is always available in any scope as an
external function name, unless ..." (with a very similar list of exclusions).
That does not mean poor old Fred exists everywhere!
As a fundamental principle, entities only exist if the standard says they do.
And they only have a particular attribute or characteristic if the standard says
they do.
Cheers,
--
................................Malcolm Cohen, Nihon NAG, Tokyo.
|