lua-users home
lua-l archive

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


On Sat, Sep 11, 2010 at 7:18 AM, Alexander Gladysh <agladysh@gmail.com> wrote:
> Do we *really* need a ternary operator in Lua?

Well, there are already plenty of things already in the language that
we don't *really* need:
- a:b()
- repeat <x> until y
- Multiple return values
- The operators <, <= and ~=

...and so on. If we didn't have these we could always find ways to
work around them. But the workarounds would have pitfalls, just as "a
and b or c" does, and would make Lua code that bit less pleasant to
write. As simple and slender as Lua is, it is not aggressively so, to
the point that absolutely nothing nonessential is allowed in.

-Duncan