Ref: Your note of Thu, 5 Oct 2017 19:11:50 +0100 Brent Longborough wrote: > Jonathan, Steve > > At the risk of trying to teach the padre to say Mass, how's this for an > idea: an additional assembler option - (NO)SETABOOL - If it's unset > (default), behaviour as today; if set, then SETA 0 is treated as False, > and SETA (anything else) as True?
If an arithmetic value is used as a logical expression (enclosed in parentheses), any value other than 0 is already treated as equivalent to 1, as documented. The problems with built-in functions in logical expressions is related to the way in which these expressions are processed. Logical expressions can contain terms which are arithmetic or character expressions, and character expressions can in turn contain inner arithmetic expressions, for example for substrings or array subscripts. Before built-in functions, these were the only combinations, so there was no support for mixed expression types except the above specific cases. In particular, it was never necessary to handle a character expression nested within an arithmetic expression. The built-in functions such as ISSYM which take a character argument and return an arithmetic result created a new combination. If these had been implemented in a totally general way, that would have allowed unlimited nesting of alternating arithmetic and character expressions. However, the actual implementation was very simple, and it was only noted in retrospect that the lack of a general stacking mechanism for mixed expressions meant that work fields could be reused in unanticipated ways, with unpredictable results, so changes were made which prevented these functions being used in any context where work areas might already be in use, including most cases of logical expressions. Jonathan Scott HLASM team, IBM Hursley, UK
