From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 109D9BB81 for ; Mon, 15 Nov 2004 01:33:12 +0100 (CET) Received: from mailout02.sul.t-online.com (mailout02.sul.t-online.com [194.25.134.17]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iAF0XBeG012552 for ; Mon, 15 Nov 2004 01:33:11 +0100 Received: from fwd05.aul.t-online.de by mailout02.sul.t-online.com with smtp id 1CTUnv-0005Ae-01; Mon, 15 Nov 2004 01:33:11 +0100 Received: from [217.82.239.226] (bdid9UZDrepGRK4PG2t+3uPi2ohGwGF56x4-RGbpTMSEC0ux5WSDoc@[217.82.239.226]) by fwd05.sul.t-online.com with esmtp id 1CTUnv-27QHDs0; Mon, 15 Nov 2004 01:33:11 +0100 Message-ID: <4197F945.70503@t-online.de> Date: Mon, 15 Nov 2004 01:33:09 +0100 From: szegedy@t-online.de (Christian Szegedy) User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040808) X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Hashtbls with physical equality? References: <16791.56417.334890.765954@katsura.parc.xerox.com> In-Reply-To: <16791.56417.334890.765954@katsura.parc.xerox.com> X-Enigmail-Version: 0.85.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-ID: bdid9UZDrepGRK4PG2t+3uPi2ohGwGF56x4-RGbpTMSEC0ux5WSDoc X-TOI-MSGID: c6a0189c-87aa-4088-852f-a60a55881cae X-Miltered: at concorde with ID 4197F947.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 hash:01 hashtbl:01 filliatre:01 garbage:01 garbage:01 infeasible:01 hash:01 traversing:01 integers:01 equality:01 strings:01 explicitly:01 hack:03 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: > Is it possible in OCaml to have a hash table that can insert and retrieve > values without walking over their structure? I tried to hack something > together using Obj.magic (working from Hashtbl.ml and the size.ml example > by Filliatre) but it doesn't work for me and I'm concerned that the garbage > collector might be making the magic values obsolete. You are right: copying of values by the garbage collection makes this approach infeasible. > I have a hash table > a of strings and I'd like to avoid traversing their length on every lookup. > Do I have to explicitly use integers instead? This is certainly a good idea.