lua-users home
lua-l archive

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

On Tue, Nov 19, 2013 at 3:27 PM, Paige DePol <> wrote:
>> On Nov 19, 2013, at 5:12 PM, Coda Highland <> wrote:
>> I think the question is, what does:
>> if zero == false then print("zero == false") end
>> if zero == true then print("zero == true") end
>> output? It's one thing to change the falsiness of 0 in a boolean
>> context, but does it extend to equality comparisons?
>> /s/ Adam
> Thank you for your input, neither of those lines print anything at this time, so there is a problem somewhere. I also notice that if I change the == to ~= then both lines will print, so there is something going on with the boolean keywords themselves I think.
> I will check into the issue and see what I can find out. Thank you *very* much for your feedback, it is appreciated! :)
> ~pmd~

It may not actually be an issue. The change you've been describing has
MOSTLY been "zero is falsy" rather than "zero is identical to false".
If that's the case, I personally wouldn't have a problem with saying
that (0 == false) is false even if 0 evaluates falsy in a boolean

Really, it's the "and" and "or" operators that are the real concern,
moreso than equality comparisons.

/s/ Adam