From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA25984; Mon, 22 Mar 2004 19:17:03 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 TAA25705 for ; Mon, 22 Mar 2004 19:17:02 +0100 (MET) Received: from mail.physik.uni-muenchen.de (mail.physik.uni-muenchen.de [192.54.42.129]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i2MIHZKW030126 for ; Mon, 22 Mar 2004 19:17:35 +0100 Received: from localhost (unknown [127.0.0.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id 40955201F7 for ; Mon, 22 Mar 2004 18:17:01 +0000 (UTC) Received: from mail.physik.uni-muenchen.de ([127.0.0.1]) by localhost (mail.physik.uni-muenchen.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 09658-01-62 for ; Mon, 22 Mar 2004 19:16:57 +0100 (CET) Received: from mailhost.cip.physik.uni-muenchen.de (kaiser.cip.physik.uni-muenchen.de [141.84.136.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id B78D62007E for ; Mon, 22 Mar 2004 19:16:57 +0100 (CET) Received: from seekar.cip.physik.uni-muenchen.de (seekar.cip.physik.uni-muenchen.de [141.84.136.52]) by mailhost.cip.physik.uni-muenchen.de (Postfix) with ESMTP id 994758514F for ; Mon, 22 Mar 2004 19:16:57 +0100 (CET) Received: by seekar.cip.physik.uni-muenchen.de (Postfix, from userid 3092) id 92B5F79FD; Mon, 22 Mar 2004 19:16:57 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by seekar.cip.physik.uni-muenchen.de (Postfix) with ESMTP id 9068279FB for ; Mon, 22 Mar 2004 19:16:57 +0100 (CET) Date: Mon, 22 Mar 2004 19:16:57 +0100 (CET) From: Thomas Fischbacher To: caml-list@inria.fr Subject: [Caml-list] Hashtbl and destructive operations on keys Message-ID: X-BOFH: Daemons did it MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at physik.uni-muenchen.de X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; physik:01 hashtbl:01 hashtbl:01 hash:01 val:01 induce:99 consing:01 cip:99 physik:01 cip:99 ocaml:01 cons:03 noticeable:04 gnu:05 quite:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 307 Dear ocaml hackers, I read the documentation in such a way that I must not assume that after doing a Hashtbl.replace hash key new_val, I can destructively modify key with impunity. (I do cons a new key at every Hashtbl.add.) On the other hand (I have not looked into the sources), I am quite confident that the system _could_ give me the guarantee that nothing evil happens if I do so, and especially for the application I am presently working on, this would induce a noticeable performance gain, due to reduced consing. (And performance is important here!) So, could I please get this officially sanctioned? :-) -- regards, tf@cip.physik.uni-muenchen.de (o_ Thomas Fischbacher - http://www.cip.physik.uni-muenchen.de/~tf //\ (lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y) V_/_ (if (= x 0) y (g g (- x 1) (* x y)))) n 1)) (Debian GNU) ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners