On Tue, 2 Nov 2004, David A. Black wrote:

> #false? might be useful to avoid lengthier tests distinguishing among
> various permutations of falsehood.  I can't see too many likely uses
> for #true?

i'd really like a #true?

   yaml = <<-txt
     options:
       verbose : true  # or maybe 4
   txt

   config = YAML::load yaml

   options = config['options']

   if options['verbose'].true?
     @verbosity = 4
   else
     @verbosity = Integer options['verbose']
   end

now i use

   if TrueClass === options['verbose']
     @verbosity = 4
   else
     @verbosity = Integer options['verbose']
   end

which is kind of ugly.  espcially where i care if it true OR false and end
doing

#
# foobar can be a bool or a number
#
   if [TrueClass, FalseClass].include? options['foobar'].class
     @foobar = options['foobar']
   else
     @foobar = Integer options['foobar']
   end


yuk!

cheers.

-a
--
===============================================================================
| EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE   :: 303.497.6469
| When you do something, you should burn yourself completely, like a good
| bonfire, leaving no trace of yourself.  --Shunryu Suzuki
===============================================================================