Dan Doel <djd15 / po.cwru.edu> wrote: > > I agree that it's all right to specify that ? methods shouldn't be > required to return values other than true or false, but I don't think > the opposite is true. What I'm saying is that the return values of ? > methods should only be used in boolean situations, but they shouldn't > necessarily be required to be booleans. But there's no way of enforcing the latter. > Using the return values as other than booleans would probably be > considered unsupported, since any object that evaluated equivalently > could be used to replace the current return value and have the > function act equivalently for its intended purpose. Yes, except that it's supported and used :) If it were a hack someone came up with I'd think it ugly, but be unbothered by it. > And if you go back to ruby and duck typing, if foo? returns something > that evaluates to true/false, then it shouldn't matter if it actually > is true/false or not. Yes if there's a specific documented and relied-on non-'true' true value. Not sure why I feel so prescriptive about this issue, but I find the whole thing very nonRubyish in the way it tries to pack two pieces of information into a single primitive value. martin