[D2] How to not full closure?

Jarrett Billingsley kb3ctd2 at yahoo.com
Mon Jul 14 12:31:47 PDT 2008


"Koroskin Denis" <2korden at gmail.com> wrote in message 
news:op.ueaoscr8enyajd at proton.creatstudio.intranet...
>
> Shouldn't it be heap-allocated by default? I prefer scope keywork reuse :)

You have a point there.  And I think you may have something with using 
'scope' to indicate nested functions whose stack frames are not to be 
heap-allocated.  It goes along with scope classes nicely.  You wouldn't be 
able to return a scope delegate, and it makes sense -- "this delegate only 
works in this scope.  When the scope leaves, the delegate is no longer 
valid."

Adding "scope" also makes it possible for the compiler to check that you 
don't do stupid things statically, at least in many cases. 





More information about the Digitalmars-d mailing list