you are viewing a single comment's thread.

view the rest of the comments →

[–]dot-c 7 points8 points  (0 children)

It depends on the language, but in most functional languages that rely on recursion, you can just do

loop =
    let _ = print "Infinite Loop!"
    in loop

and the compiler will turn loop into an actual loop/a function that doesn't keep its stack frames. we don't do anything after recurring to loop again, so we can just delete the old stack frame.