On Sun, Aug 30, 2009 at 10:54 PM, Jeremie Pelletier<jerem...@gmail.com> wrote:
>
> I need to try that out, its most likely a bug since 'in' means 'const scope' 
> now.
>
> Check my second code bit, the delegate is declared as scope and it doesn't 
> optimize, maybe the compiler only checks if the closure is being dereferenced 
> and if so switches to memory storage instead of stack storage without 
> checking the storage class of the closure's delegate. And even without 
> 'scope' in this case the compiler could detect that the delegate doesn't 
> leave the function scope and optimize away.

The compiler currently doesn't do anything with local delegates
declared with 'scope'. It only seems to do anything special if 'scope'
is used as a parameter storage class.

> Better yet, allow forward references for nested functions. The need to assign 
> closures to delegates to get a nested function is so C# ;)

Oh indeed ;)

Reply via email to