(j3.2006) Student misconceptions

Van Snyder Van.Snyder
Fri Sep 12 20:04:09 EDT 2008


At least two newcomers to Fortran 2003 with whom I have recently come
into contact do not realize that type compatibility is not symmetric.

It would be helpful to have a note in 4.3.1.3 to that effect.  Something
like

        NOTE 4.5a
        Type compatibility is not symmetric.  An entity of an extension
        type is not type compatible with an entity of a type of which it
        is an extension.  An entity that has a declared type is not type
        compatible with an unlimited polymorphic entity.

Those same two students thought they had to declare associate names to
get them to have the correct type, kind, rank and bounds, as is
necessary for statement function dummy arguments and FORALL induction
variables, even though 8.1.3.2 and 8.1.3.3 are quite explicit.  Perhaps
they missed the last two sentences of 8.1.3.2p1, the topic of which
should arguably be in 8.1.3.3p1.  Moving those sentences to be after the
first sentence of 8.1.3.3p1 is a reasonable solution.

This confusion is perhaps abetted by not stating in 16.5.1.6 that
entities from the scope containing the SELECT TYPE or ASSOCIATE
construct that have the same name as an associate name are not
accessible within the construct by that name (just like the case of host
association).  It does say so in 16.4p2.  A note after 16.5.1.6p1
something like the following might solve the problem:

        NOTE 16.10a
        Within the construct, an entity identified by a global or
        local name that is the same as an associate name is not
        accessible by that name (16.4).





More information about the J3 mailing list