[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Ternary operator patch
- From: Pierre Chapuis <catwell@...>
- Date: Sun, 12 Sep 2010 16:52:16 +0200
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
--
Pierre Chapuis
- References:
- Re: Ternary operator patch, steve donovan
- 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, Alexander Gladysh
- Re: Ternary operator patch, Duncan Cross
- Re: Ternary operator patch, Eric Man