From: Mohammad Khan Date: 2004-11-02T01:17:29+09:00 Subject: Re: Another scrach on head On Sat, 2004-10-30 at 00:03, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Another scrach on head" > on Sat, 30 Oct 2004 03:38:43 +0900, Jamis Buck writes: > > |No, I mispoke for the sake of simplification. nil and false _evaluate to > |false_ in a boolean context, and everything else evaluates to _true_ in > |a boolean context. > > Ruby never get passed on telephone test. > > "In Ruby, nil and false are false, but nil is not false, because false > does not equal to nil.." > > matz. Hi Matz, Thanks for your reply. What about 'true'? My point was, a = Whatever.new # other than NilClass or FalseClass if a # block 1 end if a == true # block 2 end block 1 and block 2 will be executed only when a.class is TrueClass. I guess, in #1 other than nil and false, everything is considering as true. and in #2 we are doing equality test with 'true' that will return a boolean. If, I am right, shouldn't we have two have method 'false?' and 'true?' that will return boolean based on equality test with false and true respectively just like nil?. I am sorry, If I am misunderstanding something or requesting something that shouldn't be. regards, Mohammad