From: Mohammad Khan Date: 2004-10-30T06:29:45+09:00 Subject: Re: Another scrach on head > David, > > I don't agree at this point, I would like to say > > puts "a is neither nil, nor false, nor FALSE" if a > puts "a is true" if a == true > > I consider nil, false and true as three different entity. > I don't need to show you irb screen output to illustrate it. > > Thanks, > Mohammad > Correcting myself, if it is (not nil and not false and not FALSE) only remaining state is .. true or TRUE !! :p Mohammad > > > > puts "a is false" if a.nil? > > > > in the Boolean sense of true/false. Ruby provides the constants TRUE > > and FALSE, for the respective objects; this might be a good way to > > write your example (and my additions): > > > > puts "a is nil" if a.nil? > > puts "a is neither nil, > > nor false, nor FALSE" if a > > puts "a is TRUE" if a == TRUE > > puts "a is true" if a > > puts "a is FALSE" if a == FALSE > > puts "a is false" if not a > > puts "a is nil again!" if a == nil > > puts "a is false" if a.nil? > > > > Here, I'm using 'true/false' to mean Boolean true/false, and > > TRUE/FALSE to mean the objects. > > > > > > David -- Mohammad Khan Legal Computer Solutions, Inc.