On Wed, 19 May 2004 06:34:54 +0900, Mark Sparshatt wrote:
> Richard Lionheart wrote:

<snip>

> One advantage of this is performance. Both NilClass and FalseClass
> are singleton classes so checking whether an object is nil or false
> is very easy, while allowing 0 to be false would require testing
> the type and value of the object.

Actually, since 0 is an immediate value (like nil and false), it could be tested just as easily (as I understand it).  I would guess that the reason has more to do with elegance and simplicity.  In any case, aside from the "C does it that way" camp (whom we are obviously not catering to), why should 0 or any number be false?  (Why should "" or any string be false?  Why should [] or any array be false?)  Well, they aren't.

Chris