Commits

camlspotter committed f03c1b4 Merge
  • Participants
  • Parent commits b22f8d9, 6f69cb9

Comments (0)

Files changed (4)

 - Added Option.iter
 - Added UniqueID
 - Added Once
+- Hashtbl.of_list and to_list accept double bindings
 
 2.3.0
 ------------
 let of_list size kvs =
   let tbl = Hashtbl.create size in
   List.iter (fun (k,v) ->
-    Hashtbl.replace tbl k v) kvs;
+    Hashtbl.add tbl k v) kvs;
   tbl
   
 let to_list tbl = Hashtbl.fold (fun k v st -> (k,v) :: st) tbl []
 val replace_list : ('a, 'b) Hashtbl.t -> ('a * 'b) list -> unit
+
 val of_list      : int -> ('a * 'b) list -> ('a, 'b) Hashtbl.t
+(** Double bindings can be found by [Hashtbl.find_all] *)
+
 val to_list      : ('a, 'b) Hashtbl.t -> ('a * 'b) list
+
 val find_opt     : ('a, 'b) Hashtbl.t -> 'a -> 'b option
 val find_default : 'b -> ('a, 'b) Hashtbl.t -> 'a -> 'b
 val find_or_add  : ('a -> 'b) -> ('a, 'b) Hashtbl.t -> 'a -> 'b
   
     and find_non_dir path = try f path with Prune -> ()
       (* Even if path is a dangling symlink, f path is called *)
+      (* CR jfuruse: if the initial argument contains non existent files,
+         they reach here. *)
     in
   
     List.iter (fun fname ->