From: Gavin Kistner Date: 2006-09-14T01:29:15+09:00 Subject: Re: What does it take to make an object hashable, no really... From: Tim Pease [mailto:tim.pease@gmail.com] > On 9/13/06, Farrel Lifson wrote: > > > > Is there a reason why an implementation of eql? is needed instead of > > just being able to define <=>? > > > > Farrel > > The results of <=> are always a Fixnum -- specifically 1, 0, -1 > > A Fixnum always evaluates to true in a boolean expression in Ruby. > You have to use eql? if you want to get a true/false result. Further, for some objects it's easy to say if they're equal or not, but very hard to define if one is "greater than" the other or not. For these, it's easy to define #eql? but impossible to define #<=>