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

Walter Bright newshound at digitalmars.com
Fri Jun 2 22:06:27 PDT 2006


Jarrett Billingsley wrote:
> "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. 

Sure, you can design the language that way. But I've had uses for ones 
that *did* update the local variables.



More information about the Digitalmars-d mailing list