mpri-funcprog-project/project/src/tests/loop/loop.lambda
2017-12-13 14:10:41 +01:00

11 lines
290 B
Plaintext

(* This program is supposed to never terminate.
This can actually work if the C compiler is
smart enough to recognize and optimize tail
calls. It works for me with clang but not with
gcc, for some reason. *)
let rec loop = fun x ->
let _ = print x in
loop (x + 1)
in
loop 0