From: "John M. Dlugosz" <[EMAIL PROTECTED]> Date: 11 Apr 2008 20:12:41 -0000
. . . What happens? The OUTER scope no longer exists at CALL 3. Does a symbolic reference to OUTER require that the entire scope be retained, just in case? If "OUTER" itself (or OUTER::OUTER::...) is symbolic, it would need to remember everything always, just in case. I would assume so. This is no different than the "lexical-then-dynamic" rule for "goto", which always requires metadata for each label to identify them to dynamic callers. But, in both cases, it ought to be possible to do this using static metadata, incurring no runtime penalty. Yet in CALL 1, the use of OUTER makes sense, and is a normal use. This situation should be allowed, or you'll have a hard time describing exactly when OUTER may be used symbolically, since the simple description now is that all blocks are closures, but most can be optomized down. Agreed. Now look at CALL 2. The situation is similar in that the outer scope still exists, but it is much harder for OUTER to figure out where to look. Does this work? If not, again, its hard to explain just when it should or shouldn't, because cases that do are just automatic degenerate forms of "every block is a closure". --John I don't see that this is any harder; unless I'm misunderstanding you, this is just another normal closure usage case. The OUTER scope is always the one defined by outersub, no matter how many calls back in the dynamic chain it might be. -- Bob Rogers http://rgrjr.dyndns.org/