To: J3 J3/19-192r1 From: Jon Steidel Subject: RFI F18-014 OPERATION in REDUCE and CO_REDUCE Date: 2019-August-05 Interpretation Request ---------------------------------------------------------------------- NUMBER: F18/014 TITLE: TYPE of OPERATION arguments to the REDUCE intrinsic KEYWORDS: REDUCE, OPERATION, polymorphic, type DEFECT TYPE: Erratum STATUS: Submitted QUESTION: Section 16.9.161 REDUCE p3 describes the arguments to the intrinsic subroutine CO_REDUCE. The description of the ARRAY argument states: "ARRAY shall be an array of any type." It describes the OPERATION argument as: "OPERATION shall be a pure function with exactly two arguments; each argument shall be a scalar, nonallocatable, non- pointer, nonoptional dummy data object with the same type and type parameters as ARRAY. If one argument has the ASYNCHRONUS, TARGET, or VALUE attribute, the other shall have that attribute. Its result shall be a non- polymorphic scalar and have the same type and type parameters as ARRAY. OPERATION should implement a mathematically associative operation. It need not be commutative." The function result of OPERATION cannot be polymorphic. The arguments to OPERATION must have the same type as its result, and thus cannot be polymorphic. However, ARRAY can be polymorphic. This means the dynamic type of ARRAY must be the same type as the arguments and result of OPERATION. This seems like an unfortunate requirement. Was it intended that the dynamic type of ARRAY be required to match the type and type parameters of the arguments of OPERATION? ANSWER: No, this requirement was not intended. Edits are provided to correct the problem. EDITS: [408:36] change "type and type parameters" to "declared type and type parameters" [408:39] change "type and type parameters" to "declared type and type parameters" so that the description of OPERATION reads: "shall be a pure function with exactly two arguments; each argument shall be a scalar, nonallocatable, nonpointer, nonoptional dummy data object with the same declared type and type parameters as ARRAY. If one argument has the ASYNCHRONOUS, TARGET, or VALUE attribute, the other shall have the attribute. Its result shall be a non- polymorphic scalar and have the same declared type and type parameters as ARRAY. OPERATION should implement a mathematically associative operation. It need not be commutative." [409:5] change "type and type parameters" to "declared type and type parameters" so that the first sentence of Result Characteristics reads: "The result is of the same declared type and type parameters as ARRAY." SUBMITTED BY: Jon Steidel HISTORY: F18-014 m219 Submitted === END ===