Re: First Impressions on Using Alphora's Dataphor
Date: Sun, 29 Aug 2004 09:38:36 +0200
Message-ID: <Pine.LNX.4.33.0408290933220.12416-100000_at_linux.local>
On Sat, 28 Aug 2004, Rene Hartmann wrote:
> I would rather suggest using a system-defined comparison operator, which
> could be based on the internal representation of a type.
> This operator must only be consistent with the equality operator, so that
> if A = B then A <= B must also evaluate to true. Since the operator
> is only used internally for purposes of duplicate elimination, there are
> no special requirements for it.
>
OK, I must admit that things are not as easy as I thought first. I thought a comparison function which first calls the user-provided equality operator and then compares the byte representation would do, but this could lead to a situation where A < B < C but A = C.
So it seems that if the user provides an equality operator, s/he must also provide <=.
But I think a user-provided equality operator is rarely possible, because equality could be based on a possible representation, and <= could too.
-- Rene´ HartmannReceived on Sun Aug 29 2004 - 09:38:36 CEST