From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA00305 for caml-redistribution; Fri, 25 Feb 2000 19:57:54 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA31513 for ; Fri, 25 Feb 2000 18:10:23 +0100 (MET) Received: from cantina.students.cs.unibo.it (cantina.students.cs.unibo.it [130.136.3.110]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id SAA06805 for ; Fri, 25 Feb 2000 18:10:20 +0100 (MET) Received: from marsala.students.cs.unibo.it (root@marsala.students.cs.unibo.it [130.136.3.208]) by cantina.students.cs.unibo.it (8.9.3+3.2W/8.9.3/Debian 8.9.3-6) with ESMTP id SAA24811 for ; Fri, 25 Feb 2000 18:10:07 +0100 Received: (from sacerdot@localhost) by marsala.students.cs.unibo.it (8.9.3/8.9.3/Debian 8.9.3-6) id SAA18483 for caml-list@inria.fr; Fri, 25 Feb 2000 18:10:07 +0100 Date: Fri, 25 Feb 2000 18:10:07 +0100 From: Claudio Sacerdoti Coen To: caml-list@inria.fr Subject: Re: symbol managment in Caml Message-ID: <20000225181006.A18284@students.cs.unibo.it> References: <20000225131622.A4595@pcrm.win.tue.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0.1i In-Reply-To: <20000225131622.A4595@pcrm.win.tue.nl>; from Stephan Houben on Fri, Feb 25, 2000 at 13:16:22 +0100 Sender: weis Hello, I have had the same problem and I was about to write the new function when I stopped: the time taken by the hash function was not worth the extra coding. But I think that it's really a great pity that the standard library lacks such a function. Moreover, it should be really easy to implement it. Could we expect it implemented? Cheers, C.S.C. On Fri, Feb 25, 2000 at 13:16:22 +0100, Stephan Houben wrote: > Hello list, > > I am writing an interpreter for a simple language in O'Caml. > The interpreter often needs to search a hash table with a string > as key. A common optimization for this is to use pointer identity > instead of string equality, and "intern" every string before using > it as a key to the hash table. > > Unfortunately, I don't see how to do this with the current O'Caml > libs. You can do identity checks with ==, but there seems no way > to get a good hash corresponding to ==. > > Has anyone already written some code for this task? > > Thanks in advance, > > Stephan -- ----------------------------------------- Real Name: Claudio Sacerdoti Coen Address: via del Colle n.6 S. Lazzaro di Savena (BO) Italy e-mail: sacerdot@cs.unibo.it -----------------------------------------