J3/05-135r1 To: J3 From: Dan Nagle Subject: USE ..., EXCEPT: ... Date: 2005 Jan 24 With large modules with many names, perhaps long names, it may be difficult, unclear or inconvenient to use most of the names present while excluding a few (perhaps to prevent collisions). Adding a EXCEPT clause to the USE statement solves the problem. This feature is proposed in response to an informal Fortran 2003 comment from Australia (no formal comment was received). The spelling is changed from NOT to EXCEPT in response to a suggestion received. At M167 the Hate .. Love vote was 1 - 1 - 8 - 2. The difficulty on the John Reid scale was 4. Number: Title: USE EXCEPT: Submitted By: J3 Status: For Consideration References: J3/03-106, J3/04-114 Basic Functionality: A syntax to list names not to have use association when using a module. Rationale: When using a module with many public names, a few may be unwanted. Specifying those few is easier than naming the many wanted names, and less ugly than fanciful renames. Estimated Impact: 4 on the John Reid scale at 167 Detailed Specification: Add a clause to the USE statement specifying names not available via use association. If EXCEPT: is present, ONLY is not, and there are no renames (in the ). (It makes no sense to say "don't use this name, and call it 'foo'".) When the same module name appears in several use statements, if any have an ONLY clause, none may have an EXCEPT clause, if any have an EXCEPT clause, none may have an ONLY clause. If a name appears in an , it may not be the in a . Note that the edits are proposed to illustrate the degree of difficulty of modifying the standard, and to provide an example of the edits the above specifications might require. Possible edits follow: [251:20+] Add: "*or* USE [[, ] :: ] [, ] , EXCEPT: [ ] [251:29+] " *is* *or* " [252:7+] Add: "C1115+ (R1109) If ONLY: appears, EXCEPT: shall not appear; if EXCEPT: appears, ONLY: shall not appear. C1115++ (R1109) If a name appears in any on any with the same in a scoping unit, it shall not appear as the in any on any with the same in that scoping unit." [252:14+] Add: "A USE statement with the EXCEPT option provides access to all those entities that appear as generic-specs, use-names, or use-defined-operators except those appearing in the ." [252:17+] Add: "When more than one USE statement for a given module appears in a scoping unit, if any such USE statement has an EXCEPT qualifier, none may have an ONLY qualifier, if any such USE statement has an ONLY qualifier, none may have an EXCEPT qualifier. If more than one such USE statement has an EXCEPT qualifier, all entities in one or more s are not accessible." History: J3/03-106, J3/04-114, J3/05-135