> I think that this lack of consistency (you may take the truth value for > something which can be "nil", not for something which can be "0" or an > empty string) is likely to shoot the "principle of least surprise" that > Matz likes ;p. And actually it shot me; and I find the upper solution not > very pretty... By "inconsistency", do you mean with other languages? The rule on what-is-truth is simple in Ruby: nil and false are the only false things. Ruby is consistent on that rule, (which to those of us who are used to it) makes a whole lot of sense. Granted, it's a gotcha when you don't know about it, or are "thinking in" some other language.