blob: ecebb519f82aa77fb4e005a4600fc162795210cb (plain
[[!meta title="Bang bang, you're dead…"]]
[[!meta author="Daniel Silverstone"]]
[[!meta date="2005-03-02 18:45:48 +0000"]]
[[!tag converted-badly-from-textile tech]]
Thanks to everyone who has commented about ternary operators. In
particular; thanks to Steve Alexander for pointing out [PEP
308](http://www.python.org/peps/pep-0308.html) to me along with [this
that the python guys made the right choice.
Thanks also to the several people (namely Jonathon Jongsma, Matthew Good
and [Ross Burton](http://burtonini.com/) ) for either emailing me or
finding me on IRC to tell me about the fact that
`cond and truth or falsehood` is also a python idiom for the ternary
operator with the same caveats as the lua structure of the same form.
Gunnar Wolf made [a
about ternary operators too. Thanks for your comments there Gunnar;
interesting that perl6 will change the ternary operator from `? :` to
`?? ::`. I wonder how that will affect class/module members etc.
Unfortunately noone yet has come up with a nice plausible luaish idiom
for me to use in [Aranha](http://wiki.digital-scurf.org/Aranha) so I’m
going to have to continue to ponder them. The best I have so far is:
`(if cond then truth else falsehood)` where the parentheses are