To: J3 Members J3/17-113r1 From: Van Snyder & Malcolm Cohen Subject: Comments on Clause 15 References: 17-007 Date: 2017 February 13 0. Introduction =============== All of the recommended edits are intended to be purely editorial except where otherwise stated (the edit for 306:21). 1. Edits ======== [302:17] 15.3.2.2 Characteristics of dummy data objects, p1, "its type" -> "its declared type", after "type parameters" delete "(if any)". {Obviously it is the declared type that is meant here. The phrase "(if any)" is rarely necessary and is not necessary here, e.g. it does not appear in 15.4.1p1 after "dummy arguments".} [302:28] 15.3.2.4 Characteristics of asterisk dummy arguments, p1 Replace with "A dummy argument that is an asterisk has no other characteristic." {According to 15.3.2.1p1, an asterisk as a dummy argument has the characteristic that it is an alternate return indicator. Number disagreement in the current text.} [302:30] 15.3.3 Characteristics of function results, p1 "its type" -> "declared type", After "type parameters" delete "(if any)". {Similar to [302:17].} [306:20] 15.4.3.4.1 Generic identifiers, p3, "interface block" -> "generic interface" {Specify what generic names do when it is a GENERIC statement as well as a generic interface block. Also, there is not necessarily a single interface block in question, so "the" interface block was always wrong.} [306:21] Same paragraph, "the interface block" -> "the generic interface". {TECHNICAL EFFECT: Allow a generic name to be the same as a specific name when the generic is specified by a GENERIC statement. Also this was wrong in the non-singular interface block situation.} [306:23-24] Same subclause, p4, "the interface block" -> "the generic interface". {There does not have to be a singular interface block. This needs to include the GENERIC statement.} [308:0+7] 15.4.3.4.2 Defined operations, NOTE 15.7, Replace "function call" with "function reference". {Correct terminology.} [309:0+2-3] 15.4.3.4.3 Defined assignments, NOTE 15.9, Change "A procedure whose second dummy argument has the ALLOCATABLE or POINTER attribute cannot be accessed via defined assignment, even if it given the ASSIGNMENT ( = ) generic identifier." to "A procedure which has a generic identifier of ASSIGNMENT(=) and whose second dummy argument has the ALLOCATABLE or POINTER attribute cannot be directly invoked by defined assignment." {Fix ungrammaticality.} [309:7+3] 15.4.3.4.5 Restrictions on generic declarations, NOTE 15.10, Replace "interface blocks" with "generic identifiers specified by interface blocks or GENERIC statements". {Include GENERIC statements in this explanation.} [315:0+18-19] 15.5.1 Syntax of a procedure reference, NOTE 15.17, Change "host instance of MY_INTEGRATION called from INTEGRATE" to "instance of MY_INTEGRATION that calls INTEGRATE". {Description was garbled.} [317:0+7] 15.5.2.3 Argument association, NOTE 15.20, After "the effect is as if the actual argument" change "is assigned to a temporary, and the temporary is then" to "were assigned to a variable, and that variable were then". {Use subjunctive. Use "variable" instead of misusing "temporary" as a noun.} [318:29-30] 15.5.2.4 Ordinary dummy variables, p14, ";" -> ", and", "(including ...designator)" -> "", making that whole paragraph read "If a dummy argument is an assumed-shape array, the rank of the actual argument shall be the same as the rank of the dummy argument, and the actual argument shall not be an assumed-size array. {The sentence reads better with ", and" instead of semicolon. The parenthetical requirement is redundant because no scalar can have the same rank as an array already.} [328] 15.5.5.2 Resolving procedure references to names established to be generic, NOTE 15.38 "In the USE statement case...", Move NOTE 15.38 to precede NOTE 15.37, and change "In the USE statement case, it is possible, because of the renaming facility, for the name in the reference to be" to "Because of the renaming facility of the USE statement, the name in the reference can be" and change "the name" to "the usual name", making the whole NOTE read "Because of the renaming facility of the USE statement, the name in the reference can be different from the usual name of the intrinsic procedure." {Move the note to immediately follow the paragraph to which it refers. Reword and simplify. Insert "usual" because there is no doubt that the name of the intrinsic procedure *in this scope* is the name used.} [337:near the end] 15.7 Pure procedures, NOTE 15.48, "subprogram shall not" -> "subprogram cannot", "nor shall" -> "nor can" "STOP operation" -> "execute a an image control statement (including a \refstmt{STOP})", making that sentence read "From the programmer's point of view, these constraints can be summarized as follows: a pure subprogram cannot contain any operation that could conceivably result in an assignment or pointer assignment to a common variable, a variable accessed by use or host association, or an INTENT (IN) dummy argument; nor can a pure subprogram contain any operation that could conceivably perform any external file input/output or execute an image control statement (including a STOP statement)." {Replace impermissible "shall". Add image control statement execution to the prohibition summary. Explicitly list STOP statement parenthetically.} 2. Rejected edits ================= [305:5 C1505] C1501 uses "for a procedure" not "of a procedure" For consistency, replace "of a procedure" with "for a procedure". RESPONSE: C1501 is correctly using "for" a procedure defined by this subprogram (the procedure in question being the one defined by the subprogram), C1505 is correctly using "of" a pure procedure (the procedure in question being the one the interface body declares). [306:18-19 15.4.3.4.1p2] Replace "type and type parameters" with "type, type parameters, and rank". Otherwise, the second and fourth list items in 15.4.3.4.5p3 cannot work. RESPONSE: There is a such a thing as implicitly typing. There is no such thing as implicit ranking. [308:12 15.4.3.4.3p2] Replace "enclosed in parentheses" with ", enclosed in parentheses if the second dummy argument does not have the VALUE attribute," so as not to appear to require processors to make two copies. Replace "second argument" with "second actual argument". RESPONSE: There is no such obligation required. There is no ambiguity with actual vs dummy here. [309:6 15.4.3.4.5p1] Replace "from a module" with "by use association" so as not to cover the case of host association from a parent module into a submodule. RESPONSE: Seems to be correct as is. Further investigation into how we describe this (and why we describe this) might be useful later. [309:14 15.4.3.5.6p3(3)] Replace "one has" with "one is a data object that has" and replace "other has" with "other is a data object that has" because a dummy function's result might have the ALLOCATABLE or POINTER attribute, and a dummy argument might be a procedure pointer. RESPONSE: Correct as is. A dummy argument with the ALLOCATABLE attribute can only be a data object already, so the procedure pointer case is uninteresting. [311:14-26 C1515-C1521] Sort according to the referenced syntax rule. RESPONSE: This makes some better, but others worse. [311:40-312:9 15.4.3.6p6-10] Starting with "it specifies the initial..." at [311:40], make the remainder of 15.4.3.6p6 and each of 15.4.3.6p7-10 list items subsidiary to "If => appears in a in a ". RESPONSE: The first list item produced by this would be a sentence continuation list item, but all the subsequent ones are independent sentences. More work would be required to untangle this. [313:21 C1529] So as not to require the user to prove a theorem involving material in Clause 7, replace "have" with "be an elemental procedure that has". RESPONSE: Correct as is. User is only required to be able to read the error message if he tries to make a nonelemental version. [315:0+8 NOTE 15.17] Replace "call" with "reference" or "invoke". RESPONSE: Not a problem. [316:11-12 15.5.2.3p2(2)] Is the "declared type part" the declared type part of the dummy argument or the actual argument? Replace "the declared type part of that target" with "the part of that target that has the same declared type as the dummy argument". RESPONSE: This is wrong. The actual argument might have multiple later components with that type. [316:16-17 15.5.2.3p3(2)] Is the "declared type part" the declared type part of the dummy argument or the actual argument? Replace "the declared type part of that target" with "the part of that actual argument that has the same declared type as the dummy argument". RESPONSE: Again, this does not work. [325 first line of NOTE 15.34] It's unfortunate that a page break occurred after only one word. RESPONSE: Final typesetting will be done at the FDIS stage. [326:7 15.5.3p1] Replace "array arguments shall have the same shape" with "actual arguments shall be conformable". Compare to the last sentence of 15.5.4p1. RESPONSE: The compared sentences are different in other ways too. [329:38 C1543] C1543 is expressed in an unusual way. Replace C1543: "C1543 (R1526) "A shall not contain any more than once." RESPONSE: Correct (and clear) as is. [330:31-32 C1555] C1555 is entirely covered by C1554. Delete C1555. RESPONSE: It is not redundant. C1554 allows anything assumed-shape; C1555 requires it nonetheless to be of assumed type or interoperable type. [331:32 15.6.2.2p4] Replace "On completion of execution of the function" with "When execution of the function completes". RESPONSE: Better as is. [331:34 15.6.2.2p4] Replace "is completed" with "completes." RESPONSE: Better as is. [334:19 15.6.2.6p7] So as not to appear to allow a dummy argument in an ENTRY statement to be the same as a RESULT name, after "appears" insert "as a dummy argument". RESPONSE: Correct as is, there is no case for fine-tuned wordsmithing of an obsolescent feature. [334:37 15.6.2.6p13] For consistency with 15.6.2.6p12, replace "ELEMENTAL ... statement" with "the subprogram is an elemental subprogram". RESPONSE: Correct (and clear) as is. [335:15-16 15.6.3p2] A procedure defined by means other than Fortran might be invoked from the main program. Replace "procedure" with "scoping unit". Replace "its caller" with "that scoping unit at the point where it was invoked, as if it were a Fortran procedure". RESPONSE: Ok as is, because the foreign procedure cannot return to the caller of a Fortran main program (using e.g. longjmp) because there is no such caller. [335:25 C1576] After "transformational intrinsic" insert "function". RESPONSE: "function" is implied here by earlier wording; this is slightly poor style, but fine-tuned wordsmithing of obsolescent features is unnecessary. [337:24 C1596] NOTE 15.48 says a pure subprogram is not allowed to perform a STOP operation. That's a bit weird since the introduction says an ERROR STOP statement can appear in a pure subprogram. If that's correct, replace "or " with ", or ". Otherwise delete "or STOP operation" from NOTE 15.48 RESPONSE: A is an image control statement, and thus disallowed by C1597. [337 penultimate line of NOTE 15.48] For completeness, after "operation" insert ",or cause an impure final subroutine to be invoked". RESPONSE: Adequately explained by existing text. 3. Questions without edits ========================== [305:11-12 C1509] C1509 says an interface specification shall not specify a procedure that was specified previously in any accessible interface with the same generic identifier. A procedure might be accessible in a scoping unit using several names. Does this constraint apply to the procedure, or its local names? Does this need an interp? RESPONSE: It says shall not specify a procedure. No mention is made of any names under which is was previously done, so it is still invalid to specify the procedure even if you use a different name. [311:13+ R1518+] Would this constraint be useful, necessary or harmful? "C1514a (R1515) A that has the INTENT or PROTECTED attribute shall have the POINTER attribute." RESPONSE: This would be redundant. [331:33 15.6.2.2p4] The shape of the value returned by a function with an allocatable result is determined by the shape of its function result, if the result is allocated. Should it be required to be allocated (because otherwise it has no shape)? It's hard to imagine otherwise. If so, before "a data pointer" insert "allocatable or", and at [331:36 15.6.2.2p4] append the sentence "If the function result is allocatable, on return the function result shall be allocated." Does this need an interp? RESPONSE: It is required to be allocated, the result of a function whose result variable has the ALLOCATABLE attribute is the value of the result variable and does not have the ALLOCATABLE attribute. [336:25 C1584] Presumably the prohibition against a pure function having a polymorphic allocatable result is to foreclose the possibility to invoke an impure finalizer. Is a polymorphic allocatable ultimate component OK? Does this need an interp? RESPONSE: This should be a separate paper. 4. For future consideration =========================== [320:9 15.5.2.6] The first sentence, viz. "The actual argument shall be allocatable", could be a constraint. RESPONSE: This would be a TECHNICAL CHANGE for little result. [320:31-32 15.5.2.7p2] The first two sentences, viz. "If the dummy ... pointer assignment statement" could be a constraint. RESPONSE: This would be a TECHNICAL CHANGE for little result. [321:2-5 15.5.2.8p1-2] Both paragraphs could be constraints. RESPONSE: This would be a TECHNICAL CHANGE for little result. ===END===