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 IAA19730; Tue, 18 Nov 2003 08:47:17 +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 IAA13324 for ; Tue, 18 Nov 2003 08:47:16 +0100 (MET) Received: from smtp.web.de (smtp04.web.de [217.72.192.208]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hAI7lF121836 for ; Tue, 18 Nov 2003 08:47:15 +0100 (MET) Received: from [134.96.12.25] (helo=w451.funklan.uni-saarland.de) by smtp.web.de with asmtp (TLSv1:RC4-MD5:128) (WEB.DE 4.99 #516) id 1AM0Zv-0005Rl-00 for caml-list@inria.fr; Tue, 18 Nov 2003 08:47:15 +0100 From: Benedikt Grundmann To: caml-list@inria.fr Subject: [Caml-list] Map.iter unspecified order of visiting -- reason? Date: Tue, 18 Nov 2003 09:49:42 +0100 User-Agent: KMail/1.5.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200311180949.42786.Benedikt-Grundmann@web.de> X-Loop: caml-list@inria.fr X-Spam: no; 0.00; benedikt:01 grundmann:01 unspecified:01 val:01 unspecified:01 hashtbl:01 implements:01 bindings:01 bindings:01 unit:03 unit:03 argument:03 argument:03 iter:03 iter:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk To cite the manual of Map: val iter : (key -> 'a -> unit) -> 'a t -> unit iter f m applies f to all bindings in map m. f receives the key as first argument, and the associated value as second argument. The order in which the bindings are passed to f is unspecified. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Any special reason to do so? I mean the source code actually implements ordered visiting and it is indeed one of the great advantages of using a Map instead of a Hashtbl (the other it being sideeffect free). So why not document / require it to visit the keys in an well defined order with regard to the ordering function? Cheers, Bene ------------------- 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