Re: How delegate context work?
On Thursday, 16 March 2017 at 14:53:27 UTC, Eko Wahyudin wrote: How D access xxx variable? where context pointer refer to? How D keep xxx variable persistent? Why xxx is not swapped out when we leave first delegate? The compiler sees that you are going to reference the variable, and copies it
How delegate context work?
I'm writing promise library, and perform testing like this.. app = new Application(); Promise p = app.exec(delegate void(){ // first delegate write("Hello"); std.stdio.stdout.flush; int xxx = 777;