lua-users home
lua-l archive

Re: Ternary operator patch

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


"Paul Hudson" <phudson@pobox.com> a écrit :
>Yuk. Just use if/then/else, in that case.
I also don't like evaluating code but if/then/else has scoping problems. Here's a solution that works but is still not elegant:
a = (function(b) if b then return x else return y end end)(b)
-- 
Pierre Chapuis

AltStyle によって変換されたページ (->オリジナル) /