lua-users home
lua-l archive

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


On 9/16/2010 3:40 AM, Ryota Hirose wrote:

There are two benefits of a ternary operator, I think.
> ...
- The script code and compiled binary is shorter than other notation. So
the code will run fast.


Can you give an example of how the bytecode would be shorter? As far as I can tell, the same instructions should be generated as using an explicit if-then-else.

And people think "Other major languages have a ternary operator, but why
Lua not?"


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."

--
- tom
telliamed@whoopdedo.org