To: J3 J3/19-247 From: Van Snyder Subject: Formal requirements for conditional form Date: 2019-October-16 Reference: 18-274 1. History ========== There was a straw vote concerning 18-274, in which requirements for selection of subexpressions, or actual arguments, were described: Continue to develop conditional expressions? Yes: 13, No: 0, Undecided: 1 The requirements proposed in 18-274 were (1) Conditional expressions: based on one or more conditions, a sub-expression is selected for evaluation and the other sub-expressions are not evaluated. This encompasses the functionality of "conditional and" and "conditional not" operations. The expression form should be nestable. (2) Conditional arguments: using similar syntax, selecting an actual argument from two or more data objects. This should allow for an object not to be selected in the case of passing to an optional dummy argument. Any subscripts etc. in an unselected data object designator must not be evaluated. There was no formal vote on the requirements. There was a remark that the conditional argument form could be nested, but describing it might be complicated. The proposed requirements address the "combinatorial explosion" problem that arises if several such decisions are required within one statement. The number of blocks within an IF construct that resolves the combination of selections is an exponential function of the number of choices. 2. Formal requirements ====================== Select one entity, called a "selection" in three circumstances: (1) Conditional expressions: based on one or more conditions, select one sub-expression for evaluation. No part of a selection that is not selected shall be evaluated. The expression form shall be nestable. (2) Conditional arguments: based on one or more conditions, select an actual argument from two or more variables or expressions. It shall be possible not to select a selection in the case corresponding to an optional dummy argument, in which case the argument is considered not to be present. If the selection is a variable, that variable, not its value, is the argument. No part of a selection that is not selected shall be evaluated. The conditional argument form shall be nestable. (3) Conditional variables: based on one or more conditions, select a variable from two or more variables, to correspond to a specifier, such as STAT=, in a statement, or a variable in an input list. No part of a selection that is not selected shall be evaluated. The conditional variable form shall be nestable. 3. Remarks ========== It is conceivable that a selection could be feasible as the in an assignment statement. Because there can be only one in an assignment statement, the utility (as compared to an IF construct) does not appear to outweigh the complication. Further, resolving whether the statement is an assignment statement or the beginning of an IF construct might be delayed, depending upon the chosen syntax, thereby complicating processors. It is conceivable that a selection could be feasible as the in a pointer assignment statement. Because there can be only one in a pointer assignment statement, the utility (as compared to an IF construct) does not appear to outweigh the complication. Further, resolving whether the statement is a pointer assignment statement or the beginning of an IF construct is delayed, depending upon the chosen syntax, thereby complicating processors. It is conceivable that a selection could be feasible as a in a DO construct. Because there can be only one in a DO construct, the utility (as compared to using an auxiliary variable or pointer) does not appear to outweigh the complication. It is conceivable that a selection could be feasible as a in an . Even thought there might be more than one in an input/output statement, the utility is sufficiently rare that it is unlikely that it would outweigh the complication. It is unlikely that a selection could be feasible as the in a . The descriptions concerning variables corresponding to specifiers such as STAT= use "appear," not "present." Therefore, it is not feasible to use a conditional form that does not select a data object to indicate that a variable does not appear.