2 ms·
> Implementing recursion does not require a stack, nor does it require any special provisions for managing the stack. When I wanted recursion in Atari BASIC it
by scotty79 11y ago
> Implementing recursion does not require a stack, nor does it require any special provisions for managing the stack.
When I wanted recursion in Atari BASIC it involved implementing stacks for all my local variables (because there's not such thing as local variable in Atari BASIC).
Thinking about the task in terms of bits of work that should be put on a stack or in the queue felt way more controllable than recursion.
- LoSboccacc 11y agoOnce I needed to reimplement recursion in mathlab because the stack was too small, it was an interesting experience, I had a matrix-repurposed-as-stack and did all the push/pop manually while the recursion ran as a loop - goes to show that recursion isn't that essential if one knows how to split state, data and code properly.