lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2013/9/7 slayer beast <slayerbeast@gmail.com>:

> A ternary operator would be a nice addition to Lua 5.3 so we can stop using
> the and-or hack

A C-style ternary operator is like turnips: if you like it, you like it, and
if you don't, you don't. There is not much rational decision making over
it, it's a gut feel.

Personally I feel if one's stomach can stand the ternary operator, it
should not be upset by the and-or hack. I wish I could honestly say
that I use neither, but my code will prove that I am lying.

Actually I quite like turnips too, provided that they are used sparingly
to add some zest to a stew or soup. That's more or less my view on
'x>0 ? sqrt(x) : 0' and 'x>0 and sqrt(x) or 0' too.