From: Kent Dahl Date: 2003-09-17T23:56:58+09:00 Subject: Re: Ruby and OOP-design (question of an old "procedural person" ;) Martin DeMello wrote: > Kent Dahl wrote: >>$ ruby1.8 -v -e "p( -5.nonzero?, 5.nonzero?, 0.nonzero? )" >>ruby 1.8.0 (2003-08-04) [i686-linux] >>-5 >>5 >>nil > > > *blink* > > Okay, I'm officially Surprised. Seriously, I don't see this as a good > thing - ? methods ought to be strictly boolean IMO, and not rely on the > 'value' of true. Otherwise, some of their self-documenting nature is > lost. Not yet on the duck typing train, I see. The ?-methods are still self-documenting in the sense that they tell you how you can use the result: as a boolean. That is a type, as in "I may be used in conditionals", and not a class, as quite evident by the lack of the Boolean common ancestor. -- (\[ Kent Dahl ]/)_ _~_ _____[ http://www.pvv.org/~kentda/ ]_____/~ ))\_student_/(( \__d L b__/ (pre-) Master of Science in Technology ) ( \__\_�|�_/__/ ) _)Industrial economics and technological management( \____/_�_\____/ (____engineering.discipline_=_Computer::Technology___)