Discussion
Programming should be enjoyable
le-mark: I once saw a cobol mainframe batch program that wrote intermediate values to a file, exited, and depending on the exit code the job would resubmit its self, process the file again, and repeat until the intermediate file was empty. It was all a huge hack to get around the lack of a call stack and recursion in cobol.
juancn: It can be done mechanically, it's essentially what a compiler does.But yeah, it can be a useful technique, specially when there's tail recursion and the explicit stack just vanishes and the recursion turns into a plain old loop which the hardware just loves.