4 ms·
"The stack" can be the state of the thing you're working on. For instance when modelling something with clay, you start with crude shapes, pushing and poking t
by lupusreal 3y ago
"The stack" can be the state of the thing you're working on. For instance when modelling something with clay, you start with crude shapes, pushing and poking the clay until the crude shape looks more like what you intend, then you reapply this same process at finer and finer levels of detail. The state of the clay from previous operations is your "stack". When you've reached the finest level of detail you care to make you unwind the stack by stepping back to view your work.
Anyway, it's basically just another way of structuring the state of a loop. And if you're doing tail call recursion then the distinction essentially doesn't exist.