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 OAA02558 for caml-redistribution@pauillac.inria.fr; Fri, 25 Feb 2000 14:18:37 +0100 (MET) Resent-Message-Id: <200002251318.OAA02558@pauillac.inria.fr> 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 NAA04668 for ; Fri, 25 Feb 2000 13:13:40 +0100 (MET) Received: from pcrm.win.tue.nl (pcrm.win.tue.nl [131.155.69.41]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id NAA28410 for ; Fri, 25 Feb 2000 13:13:39 +0100 (MET) Received: (from stephan@localhost) by pcrm.win.tue.nl (8.9.3/8.9.3) id NAA04617 for caml-list@inria.fr; Fri, 25 Feb 2000 13:16:22 +0100 Message-ID: <20000225131622.A4595@pcrm.win.tue.nl> Date: Fri, 25 Feb 2000 13:16:22 +0100 From: Stephan Houben To: caml-list@inria.fr Subject: symbol managment in Caml Mail-Followup-To: caml-list@inria.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.1i Resent-From: weis@pauillac.inria.fr Resent-Date: Fri, 25 Feb 2000 14:18:37 +0100 Resent-To: caml-redistribution@pauillac.inria.fr 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