HI --

On Sun, 24 Aug 2008, Dave Bass wrote:

> But unfortunately Ruby regards both false and nil as not-true. For some
> reason, this is touted as a feature.
>
> False and nil are two quite different concepts and should not be
> conflated.

They're not conflated, though. The two objects false and nil have in
common that they present as false, in the boolean sense, so that "if
false" and "if nil" both branch away. I think that's reasonable, since
otherwise you'd have to do a lot of "if (expr).nil? ||! expr" and
stuff like that. But they're still different objects, and the concepts
of falsehood and nilness are handled separately but converge at the
point of boolean value. The same is true of, say, the objects true and
"string".

It all comes down to the difference between being an object and having
a boolean "persona".


David

-- 
Rails training from David A. Black and Ruby Power and Light:
   Intro to Ruby on Rails  January 12-15   Fort Lauderdale, FL
   Advancing with Rails    January 19-22   Fort Lauderdale, FL
See http://www.rubypal.com for details and updates!