To: J3 J3/19-187r1 From: Malcolm Cohen Subject: Rejected Request for interpretation: REDUCE in constant expressio Date: 2019-August-05 0. Reason for rejection A reference to the REDUCE intrinsic function is not permitted in a constant expression, because it cannot meet the requirements for constant expressions. That is, rule (6) of constant expressions says "a reference to a standard intrinsic function that is transformational ..., where each argument is a constant expression". Although the REDUCE intrinsic function is transformational, the OPERATION argument must be a procedure designator, in particular, a function designator. A function designator is not a constant expression as it does not satisfy any of the rules. The original text of 19-187 appears below, unchanged. =========================================================================== 1. Introduction The OPERATION argument of the REDUCE intrinsic function is permitted to be a user defined function that meets the specified requirements. A constant expression is an expression that can be used as an initializer, in declaring a named constant, or as a kind type parameter. Constant expressions in previous revisions of the standard could be evaluated at compile time. There is no restriction preventing the use of the REDUCE intrinsic function in a constant expression. The lack of this restriction permit expressions that result in invocation of user functions in constant expressions. 2. Interpretation Request ---------------------------------------------------------------------- NUMBER: F18/xxx TITLE: REDUCE intrinsic in constant expressions KEYWORDS: REDUCE, constant expression DEFECT TYPE: Erratum STATUS: Submitted Section 10.1.2 Constant expression states: "A constant expression is an expression with limitations that make it suitable for use as a kind type parameter, initializer, or named constant. It is an expression in which each operation is intrinsic, and each primary is ... (6) a reference to a standard intrinsic function that is trans- formatoinal other than COMMAND_ARGUMENT_COUNT, GET_TEAM, NULL, NUM_IMAGES, TEAM_NUMBER, THIS_IMAGE, or TRANSFER, where each argument is a constant expression." Question: REDUCE is a transformation function that can invoke a user function. Was it intended that REDUCE be allowed in a constant expression? Answer: No, it was an oversight to allow REDUCE in a constant expression. An edit is provided to fix this oversight. Edit: [158:32] after "NUM_IMAGES," insert " REDUCE," to make the entire list item read "(6) a reference to a standard intrinsic function that is trans- formational, other than COMMAND_ARGUMENT_COUNT, GET_TEAM, NULL, NUM_IMAGES, REDUCE, TEAM_NUMBER, THIS_IMAGE, or TRANSFER, where each argument is a constant expression." SUBMITTED BY: Jon Steidel HISTORY: 19-xxx m219 Submitted === END ===