09-174r1 To: J3 From: Van Snyder Subject: Defined operations and assignment Date: 2009 May 5 References: 09-007r1 1. Discussion 12.8.2p1 [316:13-14] says "If a generic name or a specific name is used to reference an elemental function, the shape of the result is the same as the shape of the actual argument with greatest rank." There's nothing subsequent in that paragraph about the case of an elemental function invoked by way of an operator. We could almost say "The shape of the result of a reference to an elemental function is the same as the shape of the actual argument with greatest rank." The problem is that we don't call the operands of a defined operation actual arguments. 12.4.3.4.3p2 [287:1-3] does, however, specify that the left-hand side and the right-hand side of defined assignment are treated as actual arguments. It would be better if we specified in both cases that they ARE actual arguments. The last sentence of 12.5.2.4p13 [296:29-31] treats operands of defined operations as if they were actual arguments. We never get around to saying that defined operations are resolved like generic names are (we do so for defined assignment at [286:22-24]). 12.4.3.4.3p1 [286:23] says defined assignment is generic if and only if there is more than one defining subroutine. The first sentence of 12.8.3p1 [317:2] should apply to both elemental functions and elemental subroutines. 2. Edits [286:10 12.4.3.4.2p1]--------------------------------------------------- Editor: Add a sentence to the paragraph: "Defined operations are generic in exact analogy to generic procedure names." {This allows resolving using 12.5.5.2.} [286:11-13 12.4.3.4.2p2]------------------------------------------------ Editor: Delete the first sentence. Replace the second sentence of 12.4.3.4.2p2 ("For a unary ... second dummy argument") by the following: "A unary defined operation is a reference to the function with its operand as the actual argument; a binary defined operation is a reference to the function with its left-hand operand as its first actual argument and its right-hand operand as its second actual argument." [286:22-23 12.4.3.4.3p1]------------------------------------------------ Editor: Delete "may, ... in which case it". [This makes defined assignment generic even in the case of only one defining subroutine. [287:1 12.4.3.4.3p2]---------------------------------------------------- Editor: Delete "treated as". [287:2-3 12.4.3.4.3p2]-------------------------------------------------- Editor: Insert "actual" before "argument" twice. [297:7,11 12.5.2.4p18 C1239, C1240]------------------------------------- Editor: Delete "(R1223)" from both constraints so they apply to defined operations and defined assignment. [316:13-14 12.8.2p1]---------------------------------------------------- Editor: Replace the first sentence of 12.8.2p1 ("If a generic ... rank") by the following: "The shape of the result of a reference to an elemental function is the same as the shape of an actual argument with greatest rank." {Specify the rank of an elemental function referenced by a defined operation as well as by name. If there is more than one argument with the greatest rank "the actual argument with greatest rank" might be construed not to exist, so use "an actual argument".} [317:2 12.8.3p1]-------------------------------------------------------- Editor: Replace "An elemental subroutine" by "It". Then move the sentence to the end of [316:4 12.8.1p1] so that it applies to all elemental procedures, not just elemental subroutines.