[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Bug with logical operator or misunderstanding?
- From: Leo Razoumov <slonik.az@...>
- Date: Thu, 20 Jan 2011 16:27:41 -0500
On Thu, Jan 20, 2011 at 11:11, Philipp Janda <siffiejoe@gmx.net> wrote:
> Am 20.01.2011 16:45, schrieb Michal Kottman:
>>
>> 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
>
Confirmed. My Lua-5.1.4 is fully patched with
http://www.lua.org/ftp/patch-lua-5.1.4-2
and on Linux x86 (32 bits) I get:
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> print(((1 or false) and true) or false)
true -- correct
> print(((1 or 2) and true) or false)
1 -- WRONG
>
Seems that the patch http://www.lua.org/bugs.html#5.1.4-3 has not
fixed the problem entirely.
--Leo--