From: ara.t.howard@... Date: 2006-04-01T00:21:22+09:00 Subject: Re: TrueClass/FalseClass vs. Boolean On Fri, 31 Mar 2006, Christian Neukirchen wrote: > "baumanj@gmail.com" writes: > >> Since everything in ruby is an object, there need to be objects for >> representing true and false. Once you have those, why do you need a >> Boolean class? > > if a.kind_of? Boolean > > case y > when Integer > when Boolean > end > > I often wanted this shortcut... indeed. i tend to use case obj when Klass when TrueClass, FalseClass end which is ugly. another thing a real Boolean class could give is a 'maybe' obj such that maybe or true -> maybe maybe or true and false or true -> maybe maybe and false -> maybe although i can't think of anything attm to do with this it would undoubtably lead to some nice logical constructs that more closely parallel the way we think. i've brought this up once or twice before - maybe we should just put together a patch and send to ruby-core? regards. -a -- share your knowledge. it's a way to achieve immortality. - h.h. the 14th dali lama