in reply to Re: Closures & aliases
in thread Closures & aliases
Okay. That explains the code, but now begs the question, why is it so?
I can think of two or three situations where I would like to use a pre-declared loop variable in a for loop and have it retain it's value afterwards.
What I cannot think of, is any benefit for it not doing so, nor any major/common caveat that it avoids.
Is a pre-declared, lexical loop variable localized (something that you cannot ordinarially do) for the loop body duration, for a "least surprise" or other DWIM benefit? Or is it simple a side-effect or caveat of the implementation?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Closures & aliases
by QM (Parson) on Jun 06, 2004 at 02:47 UTC | |
by hv (Prior) on Jun 06, 2004 at 04:05 UTC | |
|
Re^3: Closures & aliases
by diotalevi (Canon) on Jun 06, 2004 at 00:57 UTC |