[m-dev.] Inequalities and compare/3

Ralph Becket rbeck at microsoft.com
Thu Feb 1 03:39:00 AEDT 2001


I observed with the array__sort implementation that the standard
inequalities <, =<, >, >= are not defined on arbitrary types;
instead one has to use compare/3.

Is that a deliberate design decision?  If not, would it be sensible
to make X < Y a synonym for compare((<), X, Y) etc. for whatever
type X and Y share?

On that note, the reference manual makes no reference to the
standard ordering, but the comment for compare/3 in builtin.m
does.  Personally I'd be happier to have some statement on the
subject so I know when I can rely on, say, sorting an assoc_list
to do the "obvious" thing.

Cheers,

Ralph

--
Ralph Becket      |      MSR Cambridge      |      rbeck at microsoft.com 
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list