J3/17-231 To: J3 From: Malcolm Cohen Subject: USE statement mis-statements Date: 2017 October 15 1. Introduction 14.2.2 "The USE statement and use association" correctly describes, in paragraph 2, the association model: that there are local entities (with their own identifiers, usually the same identifiers as the module entities) that are associated with the module entities. However, paragraph 7 describes a different model, where the module entities have local identifiers. This is confusing. Also, the description in this subclause states that the associated entities/identifiers are "local" entities/identifiers, which contradicts the wording for the use of USE in a BLOCK construct, where they are construct entities. This is especially gratuitous in paragraph two, where the entities are first called "accessed entities" and subsequently referred to using the different term "local entities". Finally, uniqueness of use association excludes "generic interfaces and defined operators", but a defined operator is merely an identifier for a generic interface. This is both redundant and incorrect - the entity being accessed is the generic interface, and when p8 says that "Generic interfaces and defined operators are handled as described in 15.4.3.4", it is notable that 15.4.3.4 makes no mention of operators whatsoever. Edits are provided to address these flaws. 2. Edits to 17-007r2 [296:27,30,31] 14.2.2 The USE statement and use association, p2. "except that a local entity" -> "except that an accessed entity", "default, the local entities" -> "default, the accessed entities", "different local" -> "different". {Remove unnecessarily different, and incorrect, terminology/} This makes that whole enormous paragraph read: "The USE statement provides the means by which a scoping unit accesses named data objects, derived types, procedures, abstract interfaces, generic identifiers, and namelist groups in a module. The entities in the scoping unit are use associated with the entities in the module. The accessed entities have the attributes specified in the module, except that an accessed entity may have a different accessibility attribute, it may have the ASYNCHRONOUS attribute even if the associated module entity does not, and if it is not a coarray it may have the VOLATILE attribute even if the associated module entity does not. The entities made accessible are identified by the names or generic identifiers used to identify them in the module. By default, the accessed entities are identified by the same identifiers in the scoping unit containing the USE statement, but it is possible to specify that different identifiers are used. A use-associated entity is considered to have been previously defined." [298:3] Same subclause, p7, After "An accessible entity in the referenced module" change "has one or more local identifiers." to "is associated with one or more accessed entities, each with its own identifier.". {State the model we use correctly.} Note: this sentence is followed by "These identifiers are" and a list of how the identifiers are determined. [298:11] Same subclause, p8, After "Two or more accessible ultimate entities, other than generic interfaces" delete "or defined operators", and change ", may have the same local identifier only if the identifier is not used" to ", shall not be associated with the same accessed entity unless its identifier is not used". {Restate in terms of the model we actually use. Use "shall not ... unless" formulation which is clearer and more direct than "may ... only if".} [298:12] Same paragraph, Before "and handled" delete "and defined operators". {Incorrect redundancy.} [298:13-14] Same paragraph After "Except for these cases," change "the local identifier of any entity given accessibility by a USE statement shall differ from the local identifiers of all other entities accessible to the scoping unit" to "an accessed entity in a scoping unit shall not be use associated with more than one accessible entity". {Restate in terms of the model we actually use.} These edits make the whole of paragraph 8 read: "An ultimate entity is a module entity that is not accessed by use association. Two or more accessible ultimate entities, other than generic interfaces, shall not be associated with the same accessed entity unless its identifier is not used. Generic interfaces are handled as described in 15.4.3.4. Except for these cases, an accessed entity in a scoping unit shall not be use associated with more than one accessible entity." ALTERNATIVE: [298:10-14] Replace entirety of paragraph 8 with: "An ultimate entity is a module entity that is not accessed by use association. An accesed entity shall not be associated with two or more ultimate entities unless its identifier is not used, or the ultimate entities are generic interfaces. Generic interfaces are handled as described in 15.4.3.4." {Restate as a simple requirement. The first sentence is actually unchanged.} ===END===