I beg to differ. I may be wrong, but I'll still beg to differ. It's my understanding, that when a variable comes into scope, it's pushed on the stack, correct? Then when it goes out of scope, it's popped back off. Is this right?
If it is, then when a variable goes out of scope, since that portion of the stack is now "free", you've just "freed" up some memory. Right? Otherwise recursion wouldn't overflow your stack. Because otherwise, if it just hung around, there would be no point at all in declaring items in a narrower scope. Everything may as well be at the top of every function. There would be no advantage, other than name reuse, which really isn't
that great, to declaring variables right when you need them.
If it isn't, well you'll see why I'm wrong.
Quzah.