April 10 2014 Meeting Notes
Mark S. Miller
erights at google.com
Thu Apr 24 12:38:51 PDT 2014
I agree that this issue should treat for/of and [...x], etc, similarly.
Either do both or neither.
Does it alleviate the performance concerns if the .return is only invoked
on early exit, i.e., before the iterator reports that it is done? For
builtins like [...x], and for javascript code that has no statically
apparent early exit, we'd know that the only remaining early exit
possibility is a throw, which we already allow to be much slower.
On Thu, Apr 24, 2014 at 12:30 PM, Domenic Denicola <
domenic at domenicdenicola.com> wrote:
> From: es-discuss <es-discuss-bounces at mozilla.org> on behalf of Brendan
> Eich <brendan at mozilla.org>
>
> > No one is talking seriously about such a change.
>
> Why not? It seems like you'd want to perform any return-related "cleanup"
> just as clearly when you were doing `[...iterable]` or
> `Promise.all(iterable)`. What makes `for`-`of` special?
>
> Making the change only to `for`-`of`, and not all the other iterations in
> the spec, would preclude e.g. implementing `Promise.all` or `Array.from` in
> terms of `for`-`of`.
>
> Indeed, this seems related to other claims in the thread that, if
> `for`-`of` gets special-case `try { ... } finally { /* call return */ }`
> behavior, then people will be advised not to use `for`-`of`. Either because
> of a performance penalty, or because of the fact that it acts unlike every
> other iteration protocol use in the language and adds additional weird
> semantics.
>
> Am I missing something that makes the `for`-`of`--only modification more
> coherent?
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
--
Cheers,
--MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140424/da5a35d1/attachment.html>
More information about the es-discuss
mailing list