diff options
| author | Graydon Hoare <[email protected]> | 2010-11-03 09:50:25 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-11-03 09:50:25 -0700 |
| commit | 1e22a55ff25612753665a76eb3b83628379334a0 (patch) | |
| tree | a051f47d2326dfce3b4e8f26abe88dac5563dd44 /src/boot/util | |
| parent | Shift obj, type, param decls to have strata rather than effects. (diff) | |
| download | rust-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.ml | 9 |
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 [] ;; |