On 04/30/2015 05:55 AM, Vladimir Panteleev wrote:

> D closures should work in the same way as, e.g., JS closures. Try
> rewriting the program in JavaScript. If it behaves in the same way, it's
> not a D bug.

Right.

I remember Seth Ladd's Dart language presentation at the local ACCU in Silicon Valley. He was explaining how Dart was different from other languages in this respect. I think he had mentioned JavaScript with the behavior that he was not fond of, so he had designed the language the way OP wants.

He explains it here:


http://blog.sethladd.com/2012/01/for-loops-in-dart-or-fresh-bindings-for.html

Ali

Reply via email to