|
|
||
|
Dolan, Ryanne Thomas (UMR-Student) wrote:
Exactly. The only problem with nil/false is that people use these values incorrectly. nil is by no means synonomous with false, so it makes sense that nil ~= false. Being false and not defined are two very different states.
And the proposal that all types should have true/false values seems strange to me, as anything with true/false evaluations is by definition a boolean, which Lua of course already has. Would it make sense at all if "" == 0?
You are contradicting yourself here ;-) At one point you say nil ~= false because they have different meanings. At the other point you argue "" == 0 incase 'if' treats them the same.
So long as you take the convention that nil means something like "undefined" then everything makes sense the way it is.