09-302
To: J3
From: Malcolm Cohen
Subject: General scoping fixes.
Date: 2009 November 10
1. Introduction
This paper contains editorial and technical fixes related to scoping.
2. Edits to 09-007r3
[23:18-19] 1.4.4p4, penultimate sentence
"the scoping unit"->"its scope".
{Improves wording, makes it safe for scoping.}
[31:12+2-3] 2.2.5, Note 2.4,
"The scoping unit of a submodule"->"A submodule",
"accesses the scoping unit of its parent"->"accesses its parent".
{Improve awkward wording.}
[31:27] 2.3.2 Statement order, p1, last sentence,
"a scoping unit" -> "some scoping units".
{The table is not exhaustive, missing derived type definitions.}
[63:4-5] Delete "The definition may be ... host scoping unit.".
{Unnecessary waffle, possibly harmful to BLOCK constructs.}
[88:29] 5.2.1p3, first sentence.
Delete "in a scoping unit".
{Superfluous, possibly harmful to BLOCK constructs.}
[223:26-27] 9.6.4.8.2p1 Executing defined input/output data transfers,
After "is selected" insert "for an effective item",
Change "for any appropriate data transfer input/output statements
executed in that scoping unit"
to "for that item".
{The "selected" condition selects for an effective item, not for
statements; this makes it clearer. Also fixes possible harm to BLOCK
constructs.}
[274:14-15] 11.2.2
Delete "through USE statements and otherwise".
{Redundant and confusing specification of the whole universe of discourse.}
[277:6] 12.1 p2 Concepts,
"invoking scoping unit"->"procedure reference".
{Wrong already - consider statement and other construct entities.}
[277:10] 12.1p3,
Delete entire paragraph, which is incorrect and unnecessary.
{I don't know exactly what it is trying to say, but it looks like incorrect
nonsense. It is certainly wrong.}
[277:11-13] 12.1p4,
Delete entire paragraph, which is misleading and unnecessary.
{It is incomplete already (missing pointer association) and is harmful
unnecessary waffle.}
[279:9] 12.4.1p1 Interface and abstract interface,
"differing scoping units"->"differing contexts".
{Normal English meaning of normal English word "context".}
[279:14] 12.4.2.1, change title to "Interfaces and scopes".
[279:15-20]
"Within the scope of a procedure identifier, the interface of the
procedure is either explicit or implicit. The interface of an internal
procedure, module procedure, or intrinsic procedure is always explicit
in such a scope. The interface of a subroutine or a function with a
separate result name is explicit within the subprogram where the name is
accessible. \obs{The interface of a statement function is always
implicit.} Outside of the scoping unit that defines it, the interface
of an external procedure is explicit if an interface body (12.4.3.2) for
the procedure is accessible, and implicit otherwise. The interface
of a dummy procedure is explicit if an interface body for it is
accessible, and implicit otherwise."
{Fixes several problems with attempting to specify scoping at the same time
as the interface (which is unnecessary since that's what the scoping rules
do anyway). It was also wrongly conflating external and dummy procs, as
well as getting the scoping unit stuff wrong re BLOCK.}
[285:11] 12.4.3.4.5 Restrictions on generic declarations,
"within a scoping unit"->"within the scope of the identifier".
{Clarify, improve safety re BLOCK.}
[286:5-6] 12.4.3.4.5 C1212,
Change "Within ... operator and"
to "Within the scope of a generic operator, if two procedures with that
identifier have",
Delete "or both define assignment".
[286:7+] Insert new constraint
"C1212a Within the scope of the generic ASSIGNMENT (=) identifier, if
two procedures have that identifier, one shall have a dummy
argument that corresponds by position in the argument list to a
dummy argument of the other that is distinguishable from it."
{Duplicating the constraint allows clearer wording.}
[286:8] 12.4.3.4.5 C1213,
Change "Within ... (12.4.3.2)"
to "Within the scope of a ".
{Omit unnecessary cross-reference for BNF term.}
[286:10] C1214,
Change "Within ... same generic name"
to "Within the scope of a generic name, each pair of procedures
identified by that name".
[286:32] p5,
Change "Within ... if a generic name is the same"
to "Within the scope of a generic name that is the same".
[289:4+2-3] 12.4.3.7 INTRINSIC attribute, Note 12.16,
Delete the note.
{The note is totally covered by constraint C536 on page 96. If we really
must restate it here, try
"Within its scope, an identifier is not permitted to have both the
EXTERNAL and INTRINSIC attributes."}
[289:6] 12.4.3.8p1 Implicit interface specification,
"In a scoping unit where" -> "If",
[289:8]
"from a scoping unit where" -> "from where".
{Improve wording clarity, BLOCK construct safety.}
[290:15] 12.5.1 Syntax of a procedure reference, C1230,
Delete "in the scoping unit".
{Extraneous useless incorrect waffle.}
[292:3] 12.5.2.1 Argument correspondance, p1,
Change "interface accessible in the scoping unit containing the procedure
reference"
to "interface accessible by the procedure reference".
{Extraneous waffle, possibly harmful to BLOCK.}
[303:44] After "scoping unit" insert "as if the reference appeared there".
[304:3-11] 12.5.5.3 Resolving ... established to be only specific,
Replace the entirety of paragraphs 1-3 with
"If the name has the EXTERNAL attribute,
- if it is a procedure pointer, the reference is to its target;
- if is a dummy procedure that is not a procedure pointer, the
reference is to the effective argument corresponding to that
name;
- otherwise, the reference is to the external procedure with
that name."
{Existing text unnecessarily duplicative and verbose, and contradictory
for dummy procedure pointers.}
[304:12-305:2] p4-p7, Replace with
"If the identifier is that of an accessible module procedure, internal
procedure, \obs{statement function}, or intrinsic procedure,
the reference is to that procedure.".
{Don't restate all the use and host association rules, just use them by
"accessible".}
[305:3-4] p8, Delete.
{Already covered by the host association rules.}
[311:4-6] 12.6.2.6p12, ENTRY statement,
Delete entire paragraph.
{Vacuous: we already require interface bodies for functions to declare
functions and for subroutines to be subroutines. Furthermore, there
is no such thing as a "procedure header".}
[444:44-46] Move this obsolescent junk to the end of the subclause,
i.e. to [445:10-].
===END===