yield* desugaring

Brendan Eich brendan at mozilla.com
Tue May 14 10:14:09 PDT 2013


Erik Arvidsson wrote:
> Two names seems like a bad compromise. We should either do 
> `next(...args)` or `resume(...args)`. Not both.

Right, and 'resume' makes no sense for iterators.

C'mon you two whose names start with A: this bikeshedding is wasteful 
and disharmonious. We have much bigger fish to fry. Now is not the time 
to be messing around. That is all :-|.

/be

>
>
> On Tue, May 14, 2013 at 11:12 AM, Andreas Rossberg 
> <rossberg at google.com <mailto:rossberg at google.com>> wrote:
>
>     On 14 May 2013 17:07, Allen Wirfs-Brock <allen at wirfs-brock.com
>     <mailto:allen at wirfs-brock.com>> wrote:
>     >
>     > What about providing a convenience "resume" method on generators
>     to help clarify co-routine style usage?  Dave suggested that
>     "resume" was pedagogically useful.
>     >
>     > I would define it equivalently two:
>     >
>     >    resume(...args) {return this.next(...args};
>     >
>     > (resume rather than next delegates to avoid the delegation for
>     normal for-of iterations)
>
>     Not sure about having two names for the same method, but if so, why
>     not simply make Generator.prototype.resume ===
>     Generator.prototype.next?
>
>     /Andreas
>     _______________________________________________
>     es-discuss mailing list
>     es-discuss at mozilla.org <mailto:es-discuss at mozilla.org>
>     https://mail.mozilla.org/listinfo/es-discuss
>
>
>
>
> -- 
> erik


More information about the es-discuss mailing list