lua-users home
lua-l archive

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

2011/10/19 Oskar Forsslund <>:
> Can anyone think of a good way to transfer logical expressions from lua to
> c.
> expressions like
> func() and func2() and (func3() or func4())

Just replace "and" with && and "or" with ||:

func() && func2() && (func3() || func4())

AFAIK the evaluation rules are the same as in Lua (ie. if func()
returns false, the three other functions won't be called).