[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Ternary operator patch
- From: Christopher Eykamp <chris@...>
- Date: Sat, 18 Sep 2010 10:12:04 -0700
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
- References:
- Re: Ternary operator patch, Henk Boom
- Re: Ternary operator patch, steve donovan
- Re: Ternary operator patch, Geoff Leyland
- Re: Ternary operator patch, steve donovan
- Re: Ternary operator patch, Miles Bader
- Re: Ternary operator patch, David Kastrup
- Re: Ternary operator patch, Miles Bader
- Re: Ternary operator patch, David Kastrup
- Re: Ternary operator patch, Jonathan Castello
- Re: Ternary operator patch, Roberto Ierusalimschy
- Re: Ternary operator patch, Enrico Tassi
- Re: Ternary operator patch, Doug Rogers
- Re: Ternary operator patch, Ryota Hirose
- Re: Ternary operator patch, Ryota Hirose
- Re: Ternary operator patch, Tom N Harris
- Re: Ternary operator patch, Ryota Hirose
- Re: Ternary operator patch, Tom N Harris