From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 4A448BBCA for ; Mon, 12 May 2008 11:29:11 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYBAM2qJ0jUGyokmmdsb2JhbACSDwEBAQEBCAUIBxEDl0kE X-IronPort-AV: E=Sophos;i="4.27,472,1204498800"; d="scan'208";a="12489066" Received: from smtp6-g19.free.fr ([212.27.42.36]) by mail3-smtp-sop.national.inria.fr with ESMTP; 12 May 2008 11:29:10 +0200 Received: from smtp6-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp6-g19.free.fr (Postfix) with ESMTP id 8601F5FE3B; Mon, 12 May 2008 11:29:10 +0200 (CEST) Received: from morgana (pat35-1-82-229-60-210.fbx.proxad.net [82.229.60.210]) by smtp6-g19.free.fr (Postfix) with ESMTP id 6389D5FD3A; Mon, 12 May 2008 11:29:10 +0200 (CEST) Received: by morgana (Postfix, from userid 1000) id EC9211455AA; Mon, 12 May 2008 11:29:09 +0200 (CEST) From: David MENTRE To: "Till Varoquaux" Cc: "Florent Monnier" , caml-list@yquem.inria.fr Subject: Re: [Caml-list] Hashtbl.remove legal within Hashtbl.iter for the same hash table? Organization: none References: <87tzh5kxhl.fsf@linux-france.org> <200805111642.14164.fmonnier@linux-nantes.fr.eu.org> <9d3ec8300805110746s3b4ad089p9d6572a491403384@mail.gmail.com> <200805111710.06994.fmonnier@linux-nantes.fr.eu.org> <9d3ec8300805111545y34eccd27mb00187f23e779610@mail.gmail.com> Date: Mon, 12 May 2008 11:29:09 +0200 In-Reply-To: <9d3ec8300805111545y34eccd27mb00187f23e779610@mail.gmail.com> (Till Varoquaux's message of "Sun, 11 May 2008 23:45:21 +0100") Message-ID: <87ej87lvkq.fsf@linux-france.org> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam: no; 0.00; hashtbl:01 hashtbl:01 iter:01 hash:01 iter:01 gpg:01 caml-list:01 writes:01 pgp:05 fold:06 table:93 indeed:07 might:12 however:13 should:13 Hello Till, "Till Varoquaux" writes: > Indeed. The answer you got was, however, based on the actual > implementation not on the documentation. This means that, at some > point, this might evolve and not be valid anymore. If you want to be > on the safe side you should do a fold instead of an iter and collect > all of the items to remove and then remove them in a second pass. I'll do that. Thanks, d. -- GPG/PGP key: A3AD7A2A David MENTRE 5996 CC46 4612 9CA4 3562 D7AC 6C67 9E96 A3AD 7A2A