[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Ternary operator patch
- From: David Kastrup <dak@...>
- Date: Sun, 12 Sep 2010 18:36:31 +0200
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
- 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
- Re: Ternary operator patch, Pierre Chapuis