"Paul Brannan" <pbrannan / atdesk.com> wrote in
....
> > A < B # => false
> > B < A # => false
>
> It seems to me that it's enough to conclude that A and B are not
> comparable.  I wonder how this differs from the conclusion you drew.

It does not,  the above is an ``if and only if''.

>
> > To appease your valid concerns it might be better to only catch
> > ``ComparableErrors'' lets say
> >
> > module Comparable
> >     class Error < ArgumentError; end
> >     def  <(other)
> >         begin
> >             (self <=> other) < 0 ? true : false
> >         rescue  Error
> >             false
> >         end
> >     end
> >     # ...
> > end
>
> This seems like a good idea.  That way, I can retain exceptions and
> still have partial orders (or, to think about it another way, partial
> orders would be written explicitly rather than implicitly).

Ups, my post was pure fantasy and wishful thinking - I have been patching
my version of Ruby to rescue all exceptions in Comparable for sometime
now and forgot that Matz  only implemented the ``anti-reflexive part'' (your
case) of the partial order axioms -  maybe rescuing all ArgumentErrors
could be a good compromise to painlessly extend (if so desired) the current
``linear order logic'' to a more general ``partial order logic''.

>
> How do other languages handle this issue?

I don't know but using the return value ``nil'' (or something like it) from
your latter reply to signify incomparability actually seems more straight
forward to me.

....

/Christoph