I don't like flame wars, and from my POV the core team has made their position clear. But it still rankles that a fundamental element that apparently gave ALGOL no problems was omitted from Pascal.
I myself am still a fan of the
if … then … else … - expression... Maybe I should start an Oxygene compatibility mode and then allow the use of that expression through a modeswitch.
I also don't like C-style usage of ? since it breaks the otherwise-close correspondence between operators and procedure/function invocation, which in all cases evaluate parameters before applying the operation.
The "not evaluating both branches" is one of the main uses when I use that ternary operator in C(++). It was also the base idea behind the
IfThen() intrinsic and would also be the applied to the
if … then … else … - expression.
I really like the python version:
myvar = 6 if condition else 7
I don't like that order as it would require annoying changes in the parser. An initial keyword (in this case
if) makes it much easier for the parser to handle (which is also why I'd prefer something like
lambda x as x * 2 instead of Oxygene's
x => x * 2 for a shorter lambda expression syntax and also why I prefer FPC's
specialize keyword).