Delegate is left with a destroyed stack object
Marco Leise
Marco.Leise at gmx.de
Tue Nov 5 12:25:38 PST 2013
Am Wed, 30 Oct 2013 13:28:12 +0100
schrieb "Max Samukha" <maxsamukha at gmail.com>:
> On Wednesday, 30 October 2013 at 12:17:29 UTC, Max Samukha wrote:
>
> > So D managed to mess up closures, too. And that's after years
> > of countless complaints about the same issue in JS!
>
> And please no misguided arguments like
> http://blogs.msdn.com/b/ericlippert/archive/2009/11/12/closing-over-the-loop-variable-considered-harmful.aspx.
Without thinking much about it, why not call loop variables
temporaries that you cannot close over. If you want a closure
you'd have to declare the variable either inside or outside
the loop.
--
Marco
More information about the Digitalmars-d
mailing list