Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
|
|
@ -0,0 +1,20 @@
|
|||
(* Updates the base table with the bindings from add *)
|
||||
let hash_merge (base : (string, ty) Hashtbl.t) (add : (string, ty) Hashtbl.t) : unit =
|
||||
Hashtbl.iter (Hashtbl.replace base) add
|
||||
|
||||
let print_hashtbl t =
|
||||
Hashtbl.iter print_pair t
|
||||
|
||||
let h1 : (string, ty) Hashtbl.t = Hashtbl.create 10 ;;
|
||||
Hashtbl.add h1 "name" (TString "Rocket Skates") ;;
|
||||
Hashtbl.add h1 "price" (TFloat 12.75) ;;
|
||||
Hashtbl.add h1 "color" (TString "yellow") ;;
|
||||
|
||||
let h2 : (string, ty) Hashtbl.t = Hashtbl.create 10 ;;
|
||||
Hashtbl.add h2 "price" (TFloat 15.25) ;;
|
||||
Hashtbl.add h2 "color" (TString "red") ;;
|
||||
Hashtbl.add h2 "year" (TInt 1974) ;;
|
||||
|
||||
hash_merge h1 h2 ;;
|
||||
|
||||
print_hashtbl h1 ;;
|
||||
Loading…
Add table
Add a link
Reference in a new issue