caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Xavier Leroy <xleroy@pauillac.inria.fr>
To: John.Harrison@cl.cam.ac.uk (John Harrison)
Cc: caml-list@pauillac.inria.fr
Subject: Re: Polymorphic comparison
Date: Wed, 19 Oct 1994 09:47:04 +0100 (MET)	[thread overview]
Message-ID: <9410190847.AA23644@pauillac.inria.fr> (raw)
In-Reply-To: <"swan.cl.cam.:256500:941018125425"@cl.cam.ac.uk> from "John Harrison" at Oct 18, 94 01:54:01 pm

Yes, I have been thinking for a while about generalizing the
generic equality function to a generic ordering function (with three
possible results: "equal", "less than", "greater than").

It's a simple extension of the code for generic equality (order base
types as usual and use a lexicographic extension for data structures)
--- no more of a hack than generic equality itself.

Usefulness: canonical representatives (as John Harrison mentioned),
ordered binary trees such as those implementing sets and maps (but the
problem remains to attach user-defined orderings to some types), and a
unified notation for comparisons over integers, floats, strings and
characters.

There are a few difficulties in the implementation that remain to iron out
(what to do with pointers outside the heap which may point to
well-formed objects, in which case a recursive descent is needed,
but may also point to foreign objects, in which case comparison should
fail), so I can't promise this will be in the next release, but I'll
give it a try.

- Xavier Leroy




  reply	other threads:[~1994-10-19  8:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-10-18 10:40 Judicael Courant
1994-10-18 12:54 ` John Harrison
1994-10-19  8:47   ` Xavier Leroy [this message]
  -- strict thread matches above, loose matches on Subject: below --
1994-10-18 12:46 Franck.Delaplace
1994-10-18  9:43 Pierre Weis
1994-10-18  9:32 Pierre Weis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9410190847.AA23644@pauillac.inria.fr \
    --to=xleroy@pauillac.inria.fr \
    --cc=John.Harrison@cl.cam.ac.uk \
    --cc=caml-list@pauillac.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).