J3/17-231r1 To: J3 From: Malcolm Cohen Subject: USE statement mis-statements Date: 2017 October 16 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. Finally, in 19.4 Statement and construct entities, it is not immediately obvious that a USE statement has explicitly declared its accessed entities. 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:10-14] Replace entirety of paragraph 8 with: "An ultimate entity is a module entity that is not accessed by use association. An accessed 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." {Rewrite to be a simple direct requirement. The first sentence is actually unchanged.} [516:13] 19.4 Statement and construct entities, p1, Before "Two construct entities" insert a new sentence "A USE statement in a BLOCK construct explicitly declares the entities accessed by use association to be construct entities." {Make it very clear that USE works as one would expect.} ===END===