Browse thread
[Caml-list] Map.iter unspecified order of visiting -- reason?
- Benedikt Grundmann
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2003-11-18 (07:47) |
From: | Benedikt Grundmann <Benedikt-Grundmann@w...> |
Subject: | [Caml-list] Map.iter unspecified order of visiting -- reason? |
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