From: Chris Pine Date: 2004-04-05T00:45:33+09:00 Subject: Re: parent of TrueClass, FalseClass On Sat, 3 Apr 2004 00:34:20 +0900, Ara.T.Howard wrote: > if done from the start this would make some sort of sense. i just > find it a bit suprising that true and false, which are both > representations values of truth, are not related in anyway (duck > type, module inclusion, parent class, etc) and it is difficult > (verbose) in ruby code to ask > > "is this a truth value" How about this? class Object def is_truth_value? true end end In other words, every object is a truth value. Every object can go inside an 'if' statement, for example. Boolean operators will work on any ruby object, like `x && y', and can evaluate to any ruby object. In fact, I find myself wishing that some methods which return true or false would return more broad ranges of truth values. For example, I'd love to see this: if (4 <= x == y > z) ... end Chris