From: Mohammad Khan Date: 2004-10-30T03:53:05+09:00 Subject: Re: Another scrach on head On Fri, 2004-10-29 at 14:38, Jamis Buck wrote: > 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. > > Thus > > puts "here" if false > puts "there" if nil > > would print nothing, whereas > > puts "here" if true > puts "there" if 5 > puts "everywhere" if 1 && Object.new && :foobar > > would print > > here > there > everywhere > > Hope that is clearer. > > - Jamis In other words a = Whatever.new puts "a is nil" if a.nil? puts "a is neither nil, nor false" if a puts "a is true" if a == true puts "a is false" if a == false puts "a is nil again!" if a == nil Thanks for your explanation, Jamis. -- Mohammad