caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Franck.Delaplace@lri.fr
To: caml-list@pauillac.inria.fr
Subject: Polymorphic comparison
Date: Tue, 18 Oct 94 13:46:56 +0100	[thread overview]
Message-ID: <9410181246.AA00288@sun7c.lri.fr> (raw)


>I think this polymorphic comparison is quite easy to implement in the
>following way:

>#open "hashtbl";;
>let c x y = (hash x) <= (hash y);;
>

this kind of comparison would not be  appropriate in some cases.
for example when you want to use it for sorting strings 

    c "ace" "af";;

gives

- : bool = false


by convention, we intend to have this relation "ace" <= "af" since the comparison is defined
by comparing the substrings "ac" "af" 





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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-10-18 12:46 Franck.Delaplace [this message]
  -- strict thread matches above, loose matches on Subject: below --
1994-10-18 10:40 Judicael Courant
1994-10-18 12:54 ` John Harrison
1994-10-19  8:47   ` Xavier Leroy
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=9410181246.AA00288@sun7c.lri.fr \
    --to=franck.delaplace@lri.fr \
    --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).