lua-users home
lua-l archive

Re: Ternary operator patch

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


On Thu, Sep 16, 2010 at 2:20 AM, steve donovan wrote:
> Just to be different, how about a pseudo-function
> choose(cond,val1,val2) with the appropriate lazy evaluation?
pseudo?
function choose(expr,yes,no)
 if expr then return yes else return no end
end
 - Jeff

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