Suggestion: "new delegate" - delegates useable outside of the nesting function scope

Jarrett Billingsley kb3ctd2 at yahoo.com
Fri Jun 2 17:40:03 PDT 2006


"Walter Bright" <newshound at digitalmars.com> wrote in message 
news:e5qli2$2ale$1 at digitaldaemon.com...

> Then you have the issue of updates to the framed variable copies not being 
> reflected in the stack variables.

This, at least, seems to be a requirement of static closures.  In Lua, which 
supports them, when you instantiate a static closure, the values it uses 
from enclosing scopes ("upvalues") are "frozen" - they are copied into the 
closure's instance.  Then, updating the value using the closure doesn't 
affect the original variable.  This is an important feature so that multiple 
instances of closures can be created which don't step on each others' toes, 
so to speak. 





More information about the Digitalmars-d mailing list