lua-users home
lua-l archive

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


Am 20.01.2011 16:45, schrieb Michal Kottman:
> On Thu, 2011-01-20 at 10:37 -0500, Thierry Van Elsuwe wrote:
>>
>> [...]
>>
>> 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 . 
> 

Probably, but the given patch does not work for this case.

Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> print(((1 or false) and true) or false)
true
> print( (1 or 2) and true or false )
1
> print(((1 or true) and true) or false)
1
>

First test is from the bugs page and works correctly with the given
patch, second (and third) test is still wrong.


Philipp