[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Different shades of false
- From: "Marius Gheorghe" <mgheorghe@...>
- Date: Thu, 2 Mar 2006 16:37:48 -0500
> > 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.
As the {} denotes a table constructor, each time it is used it creates a new
table. This may:
a) impose implementation complications/run-time penalties as either each
table instance would have to carry an 'empty' flag with it or a check for
emptiness would have to be performed on each test;
b) create additional semantic inconsistencies as: {} ~= {} but '' == '',
false == false, nil == nil and 0 == 0.
I vote for keeping nil and false the way they are.
Marius Gheorghe