Re: Statement function host association



Richard Maine wrote:
....
> What the cited material is about is this. Given (from the rules
> elsewhere on host association) that you have an implicitly typed
> variable "shared" by host association, which scoping unit does it
> get its implicit typing from (since the implicit typing rules can be
> different in different scoping units)? The answer is the
> "outermost", "highest level", or whatever term is best. (And there
> always will be a unique highest level one).

The answer is not the "outermost" or the "highest level". It turns
out that the answer is *always* the "most local", "innermost", or
whatever term is best. No, that's not true either. It turns out that
there are no choices at all - there is only *one* possible scope to
choose from (as per the discussion with, and references cited by,
JvB). There should be no adjective used in describing the scoping
unit at all.

(There are only two places in the whole standard where terms
like "outer scope", etc., are even plausibly usable: both involve
CONTAINS. The two places are internal procedures and module
procedures. In both cases, "outer scope" might be read to mean
"host scope". There is no other sensible place to apply such terms
in the whole language. No other things described as "scoping units"
may be considered nested in any way at all. And, officially, those
are separate scopes too.)

--
J. Giles

"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare


.



Relevant Pages

  • Re: Statement function host association
    ... >> in a single scoping unit. ... > If the same entity name appears in both the host scope and any ... contained scope, it's inherited by host association there. ...
    (comp.lang.fortran)
  • Re: Statement function host association
    ... The wording in question appears in the section on how implicit typing ... If the same entity name appears in both the host scope and any contained ... the language in the standard that triggered this discussion ...
    (comp.lang.fortran)
  • Re: Scope of array initialization do loops
    ... > Rich Townsend wrote: ... >> Does the implied do loop have its own scope? ... reason NOT to use IMPLICIT NONE; I've seen just too many errors arising ... the first line of *every* subprogram I write, and in the codes of others. ...
    (comp.lang.fortran)
  • Re: NAG, Sun, Compaq possible f95 bug
    ... when IMPLICIT NONE is in effect in the enclosing ... > scoping unit, it would be impossible to use such variables. ... declaration is not actually in the scope that it applies to. ...
    (comp.lang.fortran)
  • Re: Scope of "implicit none" and interfaces - rationale?
    ... > or USE association in any context, not just interface blocks. ... Implicit mappings *ARE* inherited from hosts (except into interface ... They act just like host association, ... But I routinely take advantage of the "inheritance" of implicit none, ...
    (comp.lang.fortran)