lua-users home
lua-l archive

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


Hallo,

On Tue, Sep 14, 2010 at 1:47 PM, Martin Voigt <voigt.m@googlemail.com> wrote:
> Maybe I'm missing something. What's wrong with using a function for
> the ternary use case?
>
> local value = ternary(condition, value_if_true, value_if_false)
>

     Since Lua is an applicative language both branches would be evaluated.

-- 
-alex
http://www.artisancoder.com/