not 0 evaluates to true

Sep 30, 2014 at 9:14 PM
> print(not 0)
>
True
as opposed to Lua:
$ lua
Lua 5.2.3  Copyright (C) 1994-2013 Lua.org, PUC-Rio
> = not 0
false
Coordinator
Oct 1, 2014 at 7:21 AM
This is really unlogic for me?
All none nil values evaluate to true...
Oct 1, 2014 at 4:58 PM
Edited Oct 1, 2014 at 4:58 PM
0 seems to evaluate to false in NeoLua, though; whereas Lua forces nil/false to be the only false values.
Coordinator
Oct 1, 2014 at 6:21 PM
For me this is natural, because I have always the bits in mind. And Lua is the first language, were 0 is true. That confuses me, and I have to test and rewrite the logic emitter.

But, I am getting the idea behind ... it is hard to abstract this to .net, because .net is closer to the cpu.
Coordinator
Oct 4, 2014 at 1:53 PM
not 0
is false, now.