diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2003-06-23 13:19:35 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2003-06-23 13:19:35 +0000 |
commit | dc5c60480015284a9e841afe9aa64fa0435195a9 (patch) | |
tree | 866c9fe7259594fe6beb3432ca46cdb79c0e24f2 /stdlib | |
parent | 0c9ced52bf3ca42d3e1fba5a9ead4c9ab49bfbf7 (diff) |
Doc de iter et fold
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5617 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/hashtbl.mli | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/stdlib/hashtbl.mli b/stdlib/hashtbl.mli index a5eb7d97e..470faca80 100644 --- a/stdlib/hashtbl.mli +++ b/stdlib/hashtbl.mli @@ -73,18 +73,22 @@ val replace : ('a, 'b) t -> 'a -> 'b -> unit val iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unit (** [Hashtbl.iter f tbl] applies [f] to all bindings in table [tbl]. [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. Each binding is presented exactly once - to [f]. *) + as second argument. Each binding is presented exactly once to [f]. + The order in which the bindings are passed to [f] is unspecified. + However, if the table contains several bindings for the same key, + they are passed to [f] in reverse order of introduction, that is, + the most recent binding is passed first. *) val fold : ('a -> 'b -> 'c -> 'c) -> ('a, 'b) t -> 'c -> 'c (** [Hashtbl.fold f tbl init] computes [(f kN dN ... (f k1 d1 init)...)], where [k1 ... kN] are the keys of all bindings in [tbl], and [d1 ... dN] are the associated values. - The order in which the bindings are passed to - [f] is unspecified. Each binding is presented exactly once - to [f]. *) + Each binding is presented exactly once to [f]. + The order in which the bindings are passed to [f] is unspecified. + However, if the table contains several bindings for the same key, + they are passed to [f] in reverse order of introduction, that is, + the most recent binding is passed first. *) (** {6 Functorial interface} *) |