RosettaCodeData/Task/Associative-array-Creation/OCaml/associative-array-creation-1.ocaml

4 lines
126 B
Text
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
let hash = Hashtbl.create 0;;
List.iter (fun (key, value) -> Hashtbl.add hash key value)
["foo", 5; "bar", 10; "baz", 15];;