[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: The 4 negations of Lua
- From: Russell Haley <russ.haley@...>
- Date: Sun, 18 Sep 2016 00:27:02 -0700
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