To: J3 J3/17-131 From: Dan Nagle Date: 2017 February 15 Subject: repairs to reduce During processing of 17-115, some issues with the OPERATION argument of REDUCE were brought to subgroup's attention. This paper attempts to repair these issues. Specifically, it appears that the current description of OPERATION does not mention several restrictions that the OPERATION function must observe. To work as intended, the result of OPERATION must be a scalar to be combined with other array elements or partial results. The arguments to OPERATION must have the same attributes, since they will be different array elements of the same array, or partial results of previous application of OPERATION. Since CO_REDUCE is just sitting there, language from it is appropriated and used here, with minimal changes. When doing so, subgroup noticed that the name of the function argument is "OPERATOR" in CO_REDUCE and "OPERATION" in REDUCE. Subgroup prefers OPERATOR since it is an action noun. However, this should be subject of a straw vote. Straw Vote: 1. Should REDUCE and CO_REDUCE have the same name for the function argument? Y-N-U If the result above is Y 2. Should the function argument be named OPERATION or OPERATOR or something else? OPERATION-OPERATOR-any other-U Edits will be crafted (or not) in a different paper depending upon the outcome of the above. Edits to 17-007 [422:18-21] the current Arguments. OPERATION text: "OPERATION shall be a pure function with two arguments of the same type and type parameters as ARRAY. Its result shall have the same type and type parameters as ARRAY. The arguments and result shall not be polymorphic. OPERATION should implement a mathematically associative operation. It need not be commutative." [422:18] change "with two arguments" to "with two scalar, nonallocatable, nonpointer, nonpolymorphic, nonoptional arguments" [422:18-19] after "as ARRAY." add a sentence "If one argument has the ASYNCHRONOUS, TARGET, or VALUE attribute, the other shall have that attribute." [422:19] change "Its result shall have" to "Its result shall be a scalar and have" The new Arguments. OPERATION text: OPERATION shall be a pure function with two scalar nonallocatable, nonpointer, nonpolymorphic, nonoptional arguments. If one argument has the ASYNCHRONOUS, TARGET, or VALUE attribute, the other shall have that attribute. Its result shall have the same type and type parameters as ARRAY. The arguments and result shall not be polymorphic. OPERATION should implement a mathematically associative operation. It need not be commutative." {make OPERATION actually work}