lua-users home
lua-l archive

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



On 9/18/2010 9:21 AM, Tom N Harris wrote:
People can think what they like. "Everyone else is doing it" is never a reasonable argument. And the answer to the question is, "because Lua isn't other languages."

I concur with this point, but everyone else is doing it for the same reason Lua should: a good ternary operator allows a compact, readable way of expressing a very common construct. It would be my preference to use the syntax from Java and C++ (i.e. cond ? blah : blah). It would also be my preference to NOT try to reuse the logical operators, as it can make the resulting code more ambiguous.

"Because Lua isn't other languages" is not a reason for omitting a feature, and is not an excuse for being different for the sake of being different. Where other languages get things right, Lua should follow.

Chris Eykamp