[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: transferring logical expression from lua to c
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: Wed, 19 Oct 2011 14:32:02 +0200
2011/10/19 Oskar Forsslund <matrixsmurfen@googlemail.com>:
> 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).