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 JAA25344; Mon, 26 Apr 2004 09:49:04 +0200 (MET DST) 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 JAA24828 for ; Mon, 26 Apr 2004 09:49:03 +0200 (MET DST) Received: from lri.lri.fr (lri.lri.fr [129.175.15.1]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3Q7n2jq025042 for ; Mon, 26 Apr 2004 09:49:02 +0200 Received: from pc8-123 (pc8-123 [129.175.8.123]) by lri.lri.fr (8.12.10/jtpda-5.4) with ESMTP id i3Q7TwCr013467 ; Mon, 26 Apr 2004 09:29:59 +0200 (MEST) Received: from filliatr by pc8-123 with local (Exim 3.35 #1 (Debian)) id 1BI0Yw-0007VH-00; Mon, 26 Apr 2004 09:29:58 +0200 From: Jean-Christophe Filliatre MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16524.47734.779189.349854@gargle.gargle.HOWL> Date: Mon, 26 Apr 2004 09:29:58 +0200 To: skaller@users.sourceforge.net Cc: Richard Jones , caml-list Subject: Re: [Caml-list] Should be INSIDE STANDARD-LIB: Hashtbl.keys In-Reply-To: <1082771932.21205.654.camel@pelican.wigram> References: <20040421011904.GA1411@first.in-berlin.de> <20040423145141.B3686@pauillac.inria.fr> <20040423150322.GA21489@redhat.com> <1082771932.21205.654.camel@pelican.wigram> X-Mailer: VM 7.03 under Emacs 20.7.2 Reply-To: Jean-Christophe.Filliatre@lri.fr (Jean-Christophe Filliatre) X-MailScanner: Found to be clean X-Miltered: at = by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; filliatre:01 filliatre:01 lri:01 caml-list:01 hashtbl:01 hashtbl:01 hash:01 hides:01 restores:01 hash:01 semantics:01 bindings:01 ocaml:01 ocaml:01 writes:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk skaller writes: > > The problem is that the Ocaml hashtbl isn't a conventional > hash table. It allows multiple bindings which means it > cannot be treated as a simple container. It's probably done on purpose. Indeed, it is very convenient to implement symbol tables --- in an imperative way --- because with this semantics for Hashtbl.add a new binding really hides any previous one until the end of its scope where Hashtbl.remove restores the previous binding. This has nothing to do with Ocaml; I'm pretty sure you can find C hash tables implementations with the same feature. -- Jean-Christophe ------------------- 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