Anonymous methods – variable capture versus value capture
Variable capture vs value capture is simple enough. Let us suppose that two anonymous methods capture the same variable. Like this: Type TMyProc = reference to procedure; var i: Integer; P1, P2: TMyProc; …. i := 0; P1 := procedure begin Writeln(i); inc(i); end; P2 := procedure begin Writeln(i); inc(i); end; P1(); P2(); Writeln(i); There … Read more