4 ms·
> I don't see how it's possible to have recursion without a stack. Recursion can happen without a stack as long as function calls can happen without a stack.
by tome 12y ago
> I don't see how it's possible to have recursion without a stack.
Recursion can happen without a stack as long as function calls can happen without a stack. It's well-known how to achieve this. See Tail Call Optimization, for example.
- icarot 12y agoThat's why I said 'deficient' compilers. Yes, it is well-known. Just reuse the stack frames on the next call; dead simple.