lua-users home
lua-l archive

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


Pierre Chapuis <catwell@archlinux.us> writes:

> On Sun, 12 Sep 2010 22:16:10 +1000, Eric Man <usyd.meric@gmail.com>
> wrote:
>> How about just change the existing if-then-else-end to become a 
>> ternary operator?
>> 
>> local successful = if result==1 then void_func1(); bool_func2()
>> eiseif  result==2 then do_this(); false; else bool_func3() end
>> 
>> It returns the last thing in the block, just like lisp's "cond".
>> 
>> Big change, but IMO more elegant.
>
> Apparently nobody has it yet, I find it strange. Why not the classical:
>
> a = b ? x : y

If we wanted our languages to resemble line noise, APL would be much
more popular.

-- 
David Kastrup