From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=HTML_10_20,HTML_MESSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id E88AEBBCB for ; Mon, 21 Apr 2008 13:19:26 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AskFAIoUDEjAXQIn/2dsb2JhbACCMjekFoMd X-IronPort-AV: E=Sophos;i="4.25,689,1199660400"; d="scan'208";a="9836321" Received: from concorde.inria.fr ([192.93.2.39]) by mail2-smtp-roc.national.inria.fr with ESMTP; 21 Apr 2008 13:19:26 +0200 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m3LBJPZh025725 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 21 Apr 2008 13:19:26 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhUBAHsVDEjRVcitdGdsb2JhbACCMjeOcQEMAwQHBxSUboMd X-IronPort-AV: E=Sophos;i="4.25,689,1199660400"; d="scan'208";a="25264985" Received: from wf-out-1314.google.com ([209.85.200.173]) by mail4-smtp-sop.national.inria.fr with ESMTP; 21 Apr 2008 13:19:10 +0200 Received: by wf-out-1314.google.com with SMTP id 26so1770281wfd.0 for ; Mon, 21 Apr 2008 04:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=lKQ9K4VVXX86GTnSG5DEPpt+/RaQsGW1GGrGPpGXuv8=; b=Tf+K4+VrUcrNxF4iU44wLjO0wDLh+VkChiJLdC/ySudbVNZxT4A/nZm1kZEYpVjIUgo9ygOK5qAx7s4QlYlKq0irEYr4dbytvSQoiG3KNYpl5zf6b6Lg3X0/emxaefF4B4XJcoJQWDaF1Id4IygFCDwGMscbHZke0QyoMmpdcoY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=xQy3kEraf6t15/Gcaw6ekZaeszqpZjGqw5roRMc/TPrzA1yC7smBnE+mfPuz0NQN3EQtFsGNcAYMn0VmO4MOQTBPFZRvGzAMFzcZaIXWDvMurrt1FdGHjQNDz/4rHLSr1B0iS9bOMzC4J2Q2NDEaDSIArhWtkcp3LlN5o2f2J8o= Received: by 10.142.12.14 with SMTP id 14mr923745wfl.152.1208776749232; Mon, 21 Apr 2008 04:19:09 -0700 (PDT) Received: by 10.142.153.9 with HTTP; Mon, 21 Apr 2008 04:19:09 -0700 (PDT) Message-ID: Date: Mon, 21 Apr 2008 13:19:09 +0200 From: "Berke Durak" To: "=?UTF-8?Q?Jean-Christophe_Filli=C3=A2tre?=" Subject: Re: [Caml-list] Announce: xsetxmap, unfunctorized, Sexp-lib aware versions of Set and Map Cc: "Caml List" In-Reply-To: <480C739F.5080104@lri.fr> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_12815_20783443.1208776749218" References: <480C60DF.9010000@exalead.com> <480C739F.5080104@lri.fr> X-Miltered: at concorde with ID 480C783D.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; berke:01 durak:01 berke:01 durak:01 caml-list:01 functions:01 functions:01 marshal:01 marshal:01 modules:02 modules:02 api:02 api:02 canonical:03 canonical:03 X-Attachments: cset="UTF-8" cset="UTF-8" ------=_Part_12815_20783443.1208776749218 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 ------=_Part_12815_20783443.1208776749218 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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


------=_Part_12815_20783443.1208776749218--