[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Behavior of logical operators
- From: "Andre Naef" <andre@...>
- Date: Sun, 13 Mar 2011 12:44:22 +0100
I am somewhat at a loss understanding the following behavior of the shortcut
evaluation of the logical operators "and" and "or" in Lua 5.1.4.
The following works as expected:
> return 1 or 2
> return (1 or 2) and true
However, the following expression returns a result I do not expect:
> return (1 or 2) and true or false
I would expect this expression to return "true". What am I missing?