3 ms·
Yes. You generally just should not write a recursive function in a language without TCO/TCE.
by ragnese 6y ago
Yes. You generally just should not write a recursive function in a language without TCO/TCE.
- jdmichal 6y agoRecursion is nothing but a loop with a stack. So yes, can certainly rewrite things that way, but all you're doing is trading the stack for a stack structure on the heap.