lexical for-in/for-of loose end

Allen Wirfs-Brock allen at wirfs-brock.com
Tue Jan 31 10:47:59 PST 2012


On Jan 31, 2012, at 10:25 AM, Brendan Eich wrote:

> Allen Wirfs-Brock wrote:
>>> >  No, I meant this:
>>> >  >    let i = 42, j = 3;
>>> >    for (let x = i *= j in {});
>>> >  >  No iterations, x not in scope after -- but i is 126 after. Do Not Want (the initialiser).
>> 
>>  for the same effec:
>> 
>>  let i = 42, j = 3;
>>  for (let x  in (i *= j ,{}));
> 
> So? I wrote "effect" not "scope", now you're defending the unwanted degree of side-effecting freedom? :-|.
> 
> One can always make expressions have effects. That's not the point. The reuse of VariableDeclarationNoIn in 12.6.4 without any refactoring or semantic restriction to forbid an initialiser was a mistake. I'm glad to get rid of it, but teasing me will cause endless grumpy fear that it will live on. :-P

Oh, I'm perfectly happy to see the initializer eliminated (for the new syntax).

But  side-effects eradication, in general,  seems like a wack-a-mole effort.

Allen


More information about the es-discuss mailing list