J3/12-nnn To: J3 Subject: Editorial improvements for the next revision. From: Malcolm Cohen Date: 2013 February 06 1. Introduction This paper contains various editorial improvement suggestions for the next revision of the Fortran standard. 2. Discussion The phrase "separate interface body" should be "module procedure interface body" everywhere it appears (it already is in some places). The only kind of interface body a module procedure can have is the "separate" kind, and the wording "separate interface body" invites the question "separate from what? -- all interface bodies are separate from the definition of the procedure they describe." The semantics of rank remapping are not rigorously specified: - it does not say straight-out that the specifies the bounds for the pointer object; - the relationship between the pointer object and target applies "array element order" to the pointer object, but not the target (which can be multi-dimensional); - it says "size of the pointer object", but this is ambiguous when it comes to character or polymorphic (it is supposed to mean "number of elements" here); - it uses SIZE(data-pointer-object) to refer subsequently to the number of elements being associated, but the association hasn't been set up yet so you can't do SIZE(...); - it uses word games with "target of the pointer object" vs. "pointer target" instead of saying "associated" per element. This all points to a rewrite of 7.2.2.3p9 (p159). 9.6.2.15 rigorously specifies the semantics of SIZE= for synchronous READ, but for asynchronous READ it says the "storage units specified" instead of the "variable specified", and does not say whether blanks inserted as padding are counted. It also does not say the characters transferred by data edit descriptors, merely characters transferred. Elsewhere we say that a wait operation is "performed", not "executed". 3. As yet unresolved 2.4.3.2.1p1 says of a variable that "it can be defined and redefined", but makes no mention of becoming undefined... The definitions of "separate module procedure" and "separate module subprogram" are unsatisfying. The former is defined in 12.6.2.5 which actually only has the syntax for "separate module subprogram" (though the subclause title has "... procedures"). It would probably be better if the definition of "separate module procedure" were in 12.6.2.1, since that is where several important constraints for them are. 12.6.2.5 Separate module procedures (actually subprograms) probably belongs before 12.6.2.4 Instances of a subprogram. 4. Rejected suggestions [7.1.11p5 150:44] Make "pure function" a hot link. {No. "pure function" is not hot-linked anywhere ("pure procedures" is). If a hot link is needed, surely a cross-ref is also needed? If we want "pure function" to be hot-linked here, it should be everywhere not just here... that is the hot-link rule.} 5. Edits to 10-007r1 [Throughout] Unindex "separate interface body" on p281, index "module procedure interface body" in 12.4.1 (p279), 12.4.3.2p4 (p281) as definition, 12.6.2.1 C1249-51, [63:1-2] 4.5.2.3p1 delete "no type parameters,". {Sequence types cannot have them at all after interp F03/0120 in Corrigendum 2, so the question of type equivalence with them can no longer arise.} [152:5] "A" -> "a". Text inserted by corrigendum 2 at 6+ ditto, plus change full stop to comma. [159:30-33] 7.2.2.3p9 Replace whole paragraph with "If appears, it specifies the upper and lower bounds of each dimension of the pointer, and thus the extents; the pointer target shall be simply contiguous (6.5.4) or of rank one, and shall not be a disassociated or undefined pointer. The number of elements of the pointer target shall not be less than the number implied by the . The elements of the pointer object are associated with those of the pointer target, in array element order; if the pointer target has more elements than specified for the pointer object, the remaining elements are not associated with the pointer object." {Describe rank remapping more rigorously.} [216:32-36] 9.6.2.15p1-2 replace entirely with "The SIZE= specifier in a nonadvancing input statement causes the variable specified to become defined with the count of the characters transferred from the file by data edit descriptors during the nonadvancing input operation. Blanks inserted as padding are not counted. For a synchronous input statement, this definition occurs when execution of the statement completes. For an asynchronous input statement, this definition occurs when the corresponding wait operation is performed." {Rewrite to separate the specification of the action of SIZE= from the specification of when it happens, so that we don't have to repeat the action specification twice.} [279:7] 12.4.1p1 Before "interface body", "separate"->"module procedure". {Terminology improvement.} [281:20] 12.4.3.2p4 Before "interface body", "separate"->"module procedure". {Terminology improvement.} [306:2,4,6] 12.6.2.1, C1249, C1250, and C1251 Before "interface body", "separate"->"module procedure", thrice. {Terminology improvement.} [309:8-9] 12.6.2.5p1, delete last sentence "Its ... thereof.". {Wording is problematic, better technical description needed.} [309:23-25] 12.6.2.5p3, replace entirely with "The interface of a procedure defined by a module subprogram is explicitly declared by the to be the same as its module procedure interface body, it is recursive if and only if it is declared to be recursive by the interface body, and if it is a function its result variable name is determined by the FUNCTION statement in the interface body." {Clarify how a separate module subprogram declares the interface, get the RECURSIVE attribute. We don't need to say any of this for a separate module procedure defined by a semi-normal-looking module procedure subprogram, since this is done by 12.6.2.2 and 12.6.2.3 already.} [319:bottom-1] Move BIT_SIZE up two lines (between BGT and BLE). [335:12+] Move 13.7.32 BIT_SIZE to here, becoming 13.7.30. {Not in alphabetic order.} [443:27] 16.5.1.4p1 delete ", module subprogram, or submodule subprogram". {Module/submodule subprograms don't have host instances.} [443:28] Before "module procedure interface body" insert "module subprogram, submodule subprogram," and after it insert a comma. {Module/submodule subprograms do access entities from the host module or submodule by host association.} [443:29] 16.5.1.4p1 Before "interface body", "separate"->"module procedure". {Terminology improvement.} [444:29+2] 16.5.1.4 NOTE 16.8 Before "interface body", "separate"->"module procedure". {Terminology improvement.} ===END===