lua-users home
lua-l archive

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

> > In the original Lua, 0 was logically true, because the only logically false
> > value was nil. That made sense. But since the introduction of the boolean
> > type in Lua 5, there is a slight mess in what is actually logically false,
> > causing me to reconsider on the idea of 0 being logically true.
> i don't feel too strongly about this, but if anythng, i would prefer it to be 
> the other way around: the boolean type should have only one value: true.  
> false would be a synonymous with nil.

I'm using Lua4 in my game, butI felt the need for "true" and "false".
I hacked the parser a bit to make false a synomyn of nil(and true of 1 but thats
because I need it that way) and it works really nice.
I, too, have trouble understanding why nil ~= false ?