aboutsummaryrefslogtreecommitdiff
path: root/src/boot/util
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-11-03 09:50:25 -0700
committerGraydon Hoare <[email protected]>2010-11-03 09:50:25 -0700
commit1e22a55ff25612753665a76eb3b83628379334a0 (patch)
treea051f47d2326dfce3b4e8f26abe88dac5563dd44 /src/boot/util
parentShift obj, type, param decls to have strata rather than effects. (diff)
downloadrust-1e22a55ff25612753665a76eb3b83628379334a0.tar.xz
rust-1e22a55ff25612753665a76eb3b83628379334a0.zip
Code sketch and comment notes on textual crate signatures.
Diffstat (limited to 'src/boot/util')
-rw-r--r--src/boot/util/common.ml9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/boot/util/common.ml b/src/boot/util/common.ml
index 838caa73..7a95573c 100644
--- a/src/boot/util/common.ml
+++ b/src/boot/util/common.ml
@@ -218,6 +218,15 @@ let sorted_htab_keys (tab:('a, 'b) Hashtbl.t) : 'a array =
keys
;;
+let sorted_htab_iter
+ (f:'a -> 'b -> unit)
+ (tab:('a, 'b) Hashtbl.t)
+ : unit =
+ Array.iter
+ (fun k -> f k (Hashtbl.find tab k))
+ (sorted_htab_keys tab)
+;;
+
let htab_vals (htab:('a,'b) Hashtbl.t) : ('b list) =
Hashtbl.fold (fun _ v accum -> v :: accum) htab []
;;