RosettaCodeData/Task/Ackermann-function/OCaml/ackermann-function-3.ocaml
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

8 lines
155 B
Text

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)