From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id E3C147FA66 for ; Fri, 13 May 2016 14:24:03 +0200 (CEST) IronPort-PHdr: 9a23:1FP6xBS3s086Ge2TZCkXmxa55dpsv+yvbD5Q0YIujvd0So/mwa65ZxON2/xhgRfzUJnB7Loc0qyN4/GmAzVLvc/JmUtBWaIPfidNsd8RkQ0kDZzNImzAB9muURYHGt9fXkRu5XCxPBsdMs//Y1rPvi/6tmZKSV3BPAZ4bt74BpTVx5zukbviqtuJOk4U3XKUWvBbElaflU3prM4YgI9veO4a6yDihT92QdlQ3n5iPlmJnhzxtY+a9Z9n9DlM6bp6r5YTGY2zRakzTKRZATI6KCh1oZSz7ViQBTeIs1QVWH8Xnx4AOAPF4Qv3RN+lvSLwrOtw3G+BNs37V70ucTun5qZvDhTvjXFDf3QC92zYltZ3lOYThROqpxVyx8ScNISUP/p3c6ebZtQXSnZbWd55VipdD4f6ZIwKWbkvJ+Fd+qD5rloI5TWkBBKnBKu7wztBh3mw07c7yO8hOQXLzA0uHpQFt3GC/4a9D7sbTe3glPqA9j7Edf4DnG6lsIU= Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=alain.frisch@lexifi.com; spf=None smtp.mailfrom=alain.frisch@lexifi.com; spf=None smtp.helo=postmaster@mx20.yaziba.net Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of alain.frisch@lexifi.com) identity=pra; client-ip=85.233.204.164; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain.frisch@lexifi.com"; x-sender="alain.frisch@lexifi.com"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of alain.frisch@lexifi.com) identity=mailfrom; client-ip=85.233.204.164; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain.frisch@lexifi.com"; x-sender="alain.frisch@lexifi.com"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mx20.yaziba.net) identity=helo; client-ip=85.233.204.164; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain.frisch@lexifi.com"; x-sender="postmaster@mx20.yaziba.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0ClAAAjxzVXkKTM6VVehDe8LoYUAoEwPBABAQEBAQEBAREBAQEBCQsJCSEvgi2CFgEBBCMVQRALGAICERUCAlcGDQgBAYgvrniRCAEBAQEGAgEkgQGFJIF2gleEfoJBglkFmCeBVoxIiT+FWo8/AjeCMBIKgU2JRgEBAQ X-IPAS-Result: A0ClAAAjxzVXkKTM6VVehDe8LoYUAoEwPBABAQEBAQEBAREBAQEBCQsJCSEvgi2CFgEBBCMVQRALGAICERUCAlcGDQgBAYgvrniRCAEBAQEGAgEkgQGFJIF2gleEfoJBglkFmCeBVoxIiT+FWo8/AjeCMBIKgU2JRgEBAQ X-IronPort-AV: E=Sophos;i="5.24,614,1454972400"; d="scan'208";a="218173420" Received: from mx20.yaziba.net ([85.233.204.164]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 13 May 2016 14:23:54 +0200 Received: from mta10.int.yaziba.net (mta10.int.yaziba.net [10.4.20.30]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx20.yaziba.net (mx10.yaziba.net) with ESMTPS id 2AE2C1A7BE1; Fri, 13 May 2016 14:23:54 +0200 (CEST) Received: from mta10.int.yaziba.net (localhost [127.0.0.1]) by mta10.int.yaziba.net (Postfix) with ESMTPS id 5054CCA74C; Fri, 13 May 2016 14:23:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mta10.int.yaziba.net (Postfix) with ESMTP id 3ED39CA75E; Fri, 13 May 2016 14:23:54 +0200 (CEST) X-Virus-Scanned: amavisd-new at mta10.int.yaziba.net Received: from mta10.int.yaziba.net ([127.0.0.1]) by localhost (mta10.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 3v1lGnFoh1dE; Fri, 13 May 2016 14:23:54 +0200 (CEST) Received: from [10.0.210.108] (unknown [185.23.92.144]) by mta10.int.yaziba.net (Postfix) with ESMTPSA id 15E23CA74C; Fri, 13 May 2016 14:23:54 +0200 (CEST) To: Gabriel Scherer , "Soegtrop, Michael" References: <0F7D3B1B3C4B894D824F5B822E3E5A172CEF1630@IRSMSX102.ger.corp.intel.com> <850765ff-25f1-ecb9-9707-74d3dc47675c@lexifi.com> <0F7D3B1B3C4B894D824F5B822E3E5A172CEF175C@IRSMSX102.ger.corp.intel.com> Cc: "caml-list@inria.fr" From: Alain Frisch Message-ID: Date: Fri, 13 May 2016 14:23:52 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-DRWEB-SCAN: ok X-VRSPAM-SCORE: -100 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrfeekledrvddugdehtdcutefuodetggdotefrucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpjgetkgfkueetnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefuvfhfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpeetlhgrihhnucfhrhhishgthhcuoegrlhgrihhnrdhfrhhishgthheslhgvgihifhhirdgtohhmqeenucfkphepudekhedrvdefrdelvddrudeggeenucfrrghrrghmpehmohguvgepshhmthhpohhuth X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht Subject: Re: [Caml-list] Specify the default hash function for a type On 13/05/2016 14:01, Gabriel Scherer wrote: >>>From the C side it is possible to create "custom" values that come > with user-specified comparison and hashing functions. However, for now > the runtime does not allow creating them from OCaml -- this is indeed > a desirable feature, but it's not trivial to implement. I don't really > whether it's actually "really hard", or just that it requires some > effort that nobody has invested yet -- the latter would be my guess. The problem is that the custom comparison function could move objects in the heap if it triggers a GC, and the polymorphic functions (compare/hash) would need to take this into account, i.e. register all "pending" nodes as GC roots. This could slow them down quite a bit. Alain