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 KAA07125; Wed, 17 Oct 2001 10:31:14 +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 KAA07201 for ; Wed, 17 Oct 2001 10:31:12 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f9H8VAT03395 for ; Wed, 17 Oct 2001 10:31:11 +0200 (MET DST) Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3/3.7W) with ESMTP id RAA19833; Wed, 17 Oct 2001 17:30:45 +0900 (JST) To: qrczak@knm.org.pl Cc: caml-list@inria.fr Subject: Re: [Caml-list] Hashtbl.iter In-Reply-To: References: <9qj955$1l5$1@qrnik.zagroda> X-Mailer: Mew version 1.94.2 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20011017173045X.garrigue@kurims.kyoto-u.ac.jp> Date: Wed, 17 Oct 2001 17:30:45 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: "Marcin 'Qrczak' Kowalczyk" > Wed, 17 Oct 2001 15:28:54 +0900, Jacques Garrigue pisze: > > > If you look at the source in hashtbl.ml, clearly the answer is > > "undefined behaviour". If your new element is added in a bucket > > after the one your are currently processing then yes, otherwise no, > > And if the table is resized because of the added element, you are > completely screwed. This undefined behavior is not limited to the > choice between processing the new element or not. No, no. It is not that bad. This just means that a new array will be built, replacing the one you are currently processing. As a result further changes on the hashtable will have absolutely no impact on the behaviour of Hashtbl.iter. That said, it is not a good idea to modify a mutable data structure while you are processing it. There are immutable ones for that. Jacques Garrigue ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr