On 6 February 2012 16:28, Brendan Eich <bren...@mozilla.org> wrote:
> Andreas Rossberg wrote:
>> Agreed. As long as we don't spec something weird, the extra effort for
>> implementations shouldn't be much more than that of an extra block
>> around the loop body.
>
> To take Allen's best shot and re-fire it, what do you think should happen
> here?
>
>  for (let i = 0, skip2 = function(){i++}; i < N; i++) {
>    foo();
>    if (bar())
>      skip2();
>  }

Pretty much the same as in

  let i_ = 0, skip2_ = function(){i_++};
  for (; i_ < N; i_++) {
    let i = i_, skip2 = skip2_;
    foo();
    if (bar())
      skip2();
  }

Probably not what the programmer expected, but as others have said,
it's a trade-off. This use case seems rare, rather obfuscated style
IMHO, and you can easily work around it. So probably not something you
want to be optimizing the language semantics for.

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

Reply via email to