In article 2h1dfjF7uummU1@uni-berlin.de,
“Michael Geary” Mike@DeleteThis.Geary.com wrote in message
news:10allar4vlk2092@corp.supernews.com…what makes zero
so special that it would warrant being false?Because in the real world, zero means false.
Suppose you have zero quarts of milk in your refrigerator. I am visiting
and
I ask: Got milk?I just wanted to note that I agree with you 100% and find any other
interpretation baffling. This is a common error for me - 99% of my Ruby
programming errors stem from runtime NoMethodErrors on nil because of Ruby’s
failure to correctly interpret some boundary condition. If numbers always
evaluate to true, it seems absurd to allow them to be used in conditionals
predicating on truth - we should at least get a good diagnostic, IMHO.
Arguments about the elegance or uniformity of zero’s truth are pretty weak
in my opinion, due to the fact that Ruby does not exist in a
vacuum.
_ I think this issue is a Licorice Test[1] for Ruby. To me it’s
fundamental to the entire point of Ruby. If you are really
bothered by this, then maybe Ruby is not for you. For me, its
one of the big reasons I really like Ruby. A Ruby in which
zero was false would not be Ruby…
LOTS
of external libraries, extensions, interfaces, etc, implicitly and
explicitly require zero to be false.
_ To me one of the joys of Ruby is that it largely hides the
short sited hardware dependent idiosycrancies of underlying
implementations.
_ Booker C. Bense
[1]- Either you really like it or you hate it…
···
Mary M. Inuet <maryinuet@ya_hoo.com> wrote: