caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Berke Durak" <berke.durak@gmail.com>
To: "Jean-Christophe Filliâtre" <Jean-Christophe.Filliatre@lri.fr>
Cc: "Caml List" <caml-list@inria.fr>
Subject: Re: [Caml-list] Announce: xsetxmap, unfunctorized, Sexp-lib aware versions of Set and Map
Date: Mon, 21 Apr 2008 13:19:09 +0200	[thread overview]
Message-ID: <b903a8570804210419t674b864ex6cccd04713cbb1cd@mail.gmail.com> (raw)
In-Reply-To: <480C739F.5080104@lri.fr>

[-- Attachment #1: Type: text/plain, Size: 828 bytes --]

Yes you are right, I should have put a warning.  These modules are for
peculiar cases.
So here it is:

WARNING:  The default comparison function is not sound for non-canonical
datastructures such
as Sets and Maps.  Xset is not canonical.  Do not use Xsets or Xmap without
providing the correct
comparison function.  You must always pass the same comparison function.

(That's why I was asking if there was a Set/Map structure with canonical
representation the other day.)

Extlib provides a version where the comparison function for the keys is
stored in the map.
But I chose to not do this for some peculiar reasons.
  - I'm serializing Xmap and Xsets using Marshal, and I don't want to have
functions in the structure
  - I don't like the overhead of a wrapper structure and I don't want to
complicate the API
-- 
Berke Durak

[-- Attachment #2: Type: text/html, Size: 971 bytes --]

  reply	other threads:[~2008-04-21 11:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-21  9:39 Berke Durak
2008-04-21 10:59 ` [Caml-list] " Jean-Christophe Filliâtre
2008-04-21 11:19   ` Berke Durak [this message]
2008-04-23 12:35     ` Jon Harrop
2008-04-23 13:25       ` Brian Hurt
2008-04-23 13:56         ` [Caml-list] Announce: xsetxmap, unfunctorized, Sexp-lib awareversions " David Allsopp
2008-04-23 14:22           ` Berke Durak
2008-04-26 14:44           ` Alexandre Pilkiewicz
2008-04-23 13:41       ` [Caml-list] Announce: xsetxmap, unfunctorized, Sexp-lib aware versions " Berke Durak

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=b903a8570804210419t674b864ex6cccd04713cbb1cd@mail.gmail.com \
    --to=berke.durak@gmail.com \
    --cc=Jean-Christophe.Filliatre@lri.fr \
    --cc=caml-list@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).