> The downside, if it is a downside, is that if you take a literal C/C++ point 
> of view, and change
> 
> let a = [];
> for (let i = 0; i < 10; i++) {
> a.push(function () { return i; });
> }
> for (let j in a) {
> assert(a[j]() === j);
> }
> 
> into
> 
> let a = [];
> {
> let i = 0;
> for (; i < 10; i++) {
> a.push(function () { return i; });
> }
> }
> 
> then the assert-loop will have to change:
> 
> for (let j in a) {
> assert(a[j]() === 10);
> }
> 
> but that's what you asked for. for(let ...;;) is a special form.


Right. The choice between explicitly copying and explicitly sharing. The former 
being awkward and sharing still being available makes it look like the right 
decision.

-- 
Dr. Axel Rauschmayer
a...@rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to