lua-users home
lua-l archive

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


The latter. not evaluated first. You can read the manual to find precedence documentation.


On Sun, Sep 18, 2016, 2:27 AM Russell Haley <russ.haley@gmail.com> wrote:
On Sun, Sep 18, 2016 at 12:04 AM, Sean Conner <sean@conman.org> wrote:
> It was thus said that the Great Russell Haley once stated:
>> On Fri, Sep 16, 2016 at 11:23 PM, Sean Conner <sean@conman.org> wrote:
>> >
>> >         not a == b
>> >
>> > is true if a is not equal to b.
>>
>> Hi Sean. My result differed (Lua prompt changed for inline formatting) :
>>
>> Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
>> % not 5 == 5
>> false
>> % not 5 == 6
>> false
>>
>> %  not "Mary"=="Mary"
>> false
>> % not "Mary"=="mary"
>> false
>>
>> This was run on FreeBSD 10.3
>
>   I got hosed by precedence (darn!  Should have tested these).  They are
> being parsed as:
>
>         (not 5) == 5
>
> Try:
>
>         not (5 == 5)
>         not (5 == 6)

So does that mean I was seeing

not 5 == 6 is equal to  (not 5) == 6  or false == 6?

Thanks,

Russ

--