From: Todd Benson Date: 2007-11-16T18:04:01+09:00 Subject: Re: ruby wish-list On Nov 15, 2007 10:29 PM, Suraj Kurapati wrote: > James Britt wrote: > > you'll get a return value than can be interpreted as true or false > ^^^^^^^^^^^ > > Bingo! I don't want to restrict the return values of question-mark > methods to only true and false because I see nothing special about > 'true' and 'false'. In my mind, they are just objects that just happen > to have some useful equivalents when evaluated in a boolean context. > And that's the key point here: context. > > Who cares what the type/class of an object really is, so long as the > object can be *interpreted* in a meaningful way in the particular usage > context? Sounds like the fundamental concept of duck typing to me. :-) I'm out of my league here (again), but I should mention that even though we enjoy/love the flexibility of the Ruby language, that freeness comes with a modicum of responsibility. If you start turning ? into a Fixnum (i.e. that's what the #whatever? method returns), you've started to turn a duck in to a goose (or cat, dog, whatever). Hey, whatever floats your boat... I can't think of one single reason for a variable/accessor to have a ? on the end of it. Todd