|
|
||
|
1) On the one hand, it seems arbitrary to say that four non-truth values is better than two.
From a purist standpoint, it would make sense, I think, to insist on exactly one.
On the other hand, false is obviously not true, and (I think) nil is likewise obviously not true. So if you were going to pare it down, you'd need to get rid of one or the other. I, personally, don't want to get rid of either. So I think we're stuck with more than one non- truth value.
So, then...why not go hog wild? If we've got two, let's shoot for one 'false' value for each primitive type. nil, false, 0, "", and (for consistency) {}.
You are right. Empty table should be considered as well, for consistency.
Now it's easy to tell if a value is 'empty', but harder to tell if it's present than before.
2) I'd like Lua to match C for easier interfacing.
Alen