Robert Klemme wrote:
> daz wrote:
> >
> > but it's able to tell that a == c which might
> > be enough to keep a routine running.
>
> Definitely not:
>
> >> ar=(0..2).map { Roo.new }
> => [#<Roo:0x101957e8>, #<Roo:0x101957b8>, #<Roo:0x10195788>]
> >> ar.sort
> ArgumentError: comparison of Roo with Roo failed


Those instances are all different.  The change only helps
by detecting equality, which is possible when a == a:

  class Roo < Numeric; end
  a = Roo.new
  p [a,a].sort  # [#<Roo:0x264a66c>, #<Roo:0x264a66c>]

- Better than:
    "I can't sort these, I don't know what they are."

>
> >
> >  * numeric.c (num_cmp): added to satisfy Comparable assumption.
>
> Hm...  Doesn't sound as if the assumption was satisfied...
>

Nothing deep here, I think - just a tiny kink removed :-?


daz