From: Jamis Buck Date: 2004-10-30T03:38:43+09:00 Subject: Re: Another scrach on head Mohammad Khan wrote: > On Fri, 2004-10-29 at 14:16, Mohammad Khan wrote: > >>On Fri, 2004-10-29 at 14:05, Jamis Buck wrote: >> >> >>>By definition (in Ruby), nil and false are false, and _everything else_ >>>is true. Its an axiom in Ruby. Just as, in C, 0 is false and all other >>>integers are true. >> >>Thanks, for clarify this. My appology, I didn't know that ! >> >>-- >>Mohammad >> > > > Wait a minute, > you are trying to say, > nil and false are false. > so we should have > nil == false -> true 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 -- Jamis Buck jgb3@email.byu.edu http://www.jamisbuck.org/jamis