Closed sam701 closed 3 years ago
This code leads to stack overflow
let ff = (x, acc, f) => if x == 0 then acc else f(x-1, acc+1, f) in ff(2, 0, ff)
Error:
thread 'main' has overflowed its stack fatal runtime error: stack overflow
The reason is that both if-branches are evaluated first.
This code leads to stack overflow
Error: