3 ms·
> IF's returning values (used like a C ternary op) I assume this just refers to a conditional expression?
by PittleyDunkin 2y ago
> IF's returning values (used like a C ternary op)
I assume this just refers to a conditional expression?
- dfawcus 2y agoAs I recall, it was something like: INT x; x := IF y < 1 THEN 1 ELSE 2 FI; Possibly one could also place various statements inside the THEN and ELSE sections, as long as they ended with an expression. I've a vague impression about that, but can't properly recall. There was also a short form available, but we were never actually told that, although some folks found it themselves from reference books.
- Taniwha 2y agoA68 also allowed brackets interchangeably with the key words, you could say: x := ( y < 1 | 1 | 2 );