From: george.marrows@... (George Marrows) Date: 2003-07-15T19:15:34+09:00 Subject: Re: Booleans > While I also kind-of like the idea of a "to_b" method that can determine if a > class is logically false, I see it causing lots of problems. If that were > possible, someone might take advantage of Ruby's flexibility to make 0.to_b > be false for their program. This could lead to some real difficulty in > understanding or running other people's code. You can already override parts of Ruby to cause plenty of odd behaviour: class Fixnum def + (y) 1 end end puts "2 + 2 = #{2 + 2}" I think Matz has commented on this topic before and said that the reason that only nil and false are logically false is for performance. The test for an object being nil or false is a very quick. If logical tests instead had to call .to_b then that'd be an extra message send on every if, and, or, when, ... -- George