lua-users home
lua-l archive

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



Taj Khattra kirjoitti 25.10.2006 kello 21.13:

-- Like C/Perl "cond ? a : b" operator, done using Lua scripts.

maybe it's obvious, but one difference is that unlike C and Perl,
tricond always evaluates both expressions?

Best we can do without going under the hood.

also, tricond doesn't seem to allow false and nil as the value of
either expression?

That was not the intention, simply remove the two asserts as you well have by now.

If it didn't, there'd be no point with it.  "cond and a or b" would do.

-asko