[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Bug with logical operator or misunderstanding?
- From: Michal Kottman <k0mpjut0r@...>
- Date: Thu, 20 Jan 2011 16:45:54 +0100
On Thu, 2011-01-20 at 10:37 -0500, Thierry Van Elsuwe wrote:
> local OneOrTwo = (1 or 2)
> local a = (OneOrTwo) and true or false
> local b = (1 or 2) and true or false
> local True = true
> local c = (1 or 2) and True or false
> print(a)
> print(b)
> print(c)
> The result is :
> true
> 1
> true
> I was expecting to get the following result:
> true
> true
> true
>
> Is this a bug, or can someone can explain me why we have 1 instead of
> true?
I guess this is a known bug - http://www.lua.org/bugs.html#5.1.4-3 .