Closures and loop scope
Ali Çehreli
acehreli at yahoo.com
Tue Jun 4 16:26:34 PDT 2013
On 06/04/2013 03:42 PM, Andrei Alexandrescu wrote:
> FWIW this was discussed at a C# conference. It was a change of behavior
> or something. It was a sort of a big deal, and a matter in which
> reasonable people were disagreeing.
FWIW too, here is Dart's take on the problem: "Closures inside of Dart’s
for loops capture the value of the index, avoiding a common pitfall
found in JavaScript."
https://www.dartlang.org/docs/dart-up-and-running/contents/ch02.html#for-loops
Ali
More information about the Digitalmars-d
mailing list