From: elbows@... (Nathan Weston) Date: 2003-10-02T02:21:46+09:00 Subject: Re: Making == symmetric? Ben Giddings wrote in message news:<3F7A4EBC.20007@infofiend.com>... > > Maybe instead: > > def compare(a, b) > retval = false > if a.can_compare_to?(b) > retval = a.==(b) > end > if retval and b.can_compare_to?(a) > retval = b.==(a) > end > > return retval > end > I agree that the use of == instead of compare_to is more intuitive if people want to override equality. In general, I'm not attached to the specific names I've thrown out in this example -- Kernel#compare could just as easily be Kernel#==, if that makes more sense. Nathan