To: J3 J3/22-155 From: John Reid & Rich Bleikamp Subject: US 22, conditional arguments Date: 2022-June-21 References: 22-007r1 Discussion ---------- When J3 added conditional arguments, it added both and as new meanings for the term "actual argument". We agree with the addition of , which plays the same role as does in Fortran 2018. However, a is not an object so we feel that it is not appropriate to give it properties that objects have including type, kind type parameters, and rank, see para 4 of 15.5.2.3. Note that at the end of para 2 of the 22-007r1 introduction we have "Conditional arguments provide actual argument selection in a procedure reference." We propose the removal of as a possibility for in R1524 while in the definition of "actual argument" in 3.1 retaining the text "An , , or in a defined assignment statement, are all examples of actual arguments." This will require the introduction of a new syntax term for the present meaning of (what appears in an actual argument list). Note that this does not remove the property of generic resolution being independent of the choice of a . 15.4.3.4.5 Restrictions on generic declarations, para 3 states Two dummy arguments are distinguishable if o one is a procedure and the other is a data object, [A cannot be a procedure.] o they are both data objects or known to be functions, and neither is TKR compatible with the other, [C1538 says "Each consequent-arg of a conditional-arg shall have the same declared type, and kind type parameters." C1539 says "Either all consequent-args in a conditional-arg shall have the same rank, or be assumed-rank."] o one has the ALLOCATABLE attribute and the other has the POINTER attribute and not the INTENT (IN) attribute, [C1545 says "In a reference to a generic procedure, ... , and if any consequent-arg of a conditional-arg has the ALLOCATABLE or POINTER attribute, each consequent-arg shall have that attribute." or o one is a function with nonzero rank and the other is not known to be a function. [A cannot be a procedure.] Suggested edits follow. [317:22] In 15.5.1 Syntax of a procedure reference, in R1523, change "actual-arg" to "actual-arg-def" so that the rule becomes R1523 actual-arg-spec is [ keyword = ] actual-arg-def [317:22+] In 15.5.1 Syntax of a procedure reference, after R1523, add R1523a actual-arg-def actual-arg conditional-arg [317:27] In 15.5.1 Syntax of a procedure reference, in R1524, delete line conditional-arg [320:7] In 15.5.2.3 Conditional argument correspondence, first sentence change "actual-arg" to "actual-arg-def" so that the sentence becomes "If an actual-arg-def is a conditional-arg, each scalar-logical-expr is evaluated in order, until the value of a scalar logical-expr is true, or there are no more scalar-logical-exprs." [320:12-13, 17-20] In 15.5.2.3 Conditional argument correspondence, delete the final sentence of para 2 (which should have been added to para 4) and the whole of para 4. ===END===