RosettaCodeData/Task/Ackermann-function/OCaml/ackermann-function-3.ocaml

9 lines
155 B
Text
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
let h = Hashtbl.create 4001
let a m n =
try Hashtbl.find h (m, n)
with Not_found ->
let res = a (m, n) in
Hashtbl.add h (m, n) res;
(res)