Ternary operators are inherently ugly, the only thing a language designer can do is choose amongst the flavours of ugliness.
Having to create a syntax that lets three units (condition, true selection, false selection) be associated easily by a reader requires at least 2 operators and is an order of magnitude more awkward than binary operators. While C and Perl5 go for huffman encoding with ? : (which Perl6 is changing to ??:: IIRC), there is history for using a more verbose mechanism, requiring more verbo
ternary operators are inherently ugly (Score:2)
Having to create a syntax that lets three units (condition, true selection, false selection) be associated easily by a reader requires at least 2 operators and is an order of magnitude more awkward than binary operators. While C and Perl5 go for huffman encoding with ? : (which Perl6 is changing to ?? :: IIRC), there is history for using a more verbose mechanism, requiring more verbo
Historical huffman encodeing of ternary operator (Score:1)
The oldest is the quatenary operator or ternary if in Fortran -
which predates if..then by several years; but neary as old is the ternary operator
ifin Lispwhich with is pretty well Huffman encoded.
The beautiful thing of Perl is TIMTOWTDI ... if you won't want ternary operators, don't
Bill
# I had a sig when sigs were cool
use Sig;
Backward compatibility in Python? (Score:1)
We will adjust the syntax of what goes inside an 'if' to disallow lambda; currently
if lambda: x:is accepted but quite useless (it's always true) so this will be disallowed.
I guess backward compatibility is an issue when working with Python. That's something rather important advocacy note to remember.