Brendan Eich (2013-12-10T21:49:23.000Z)
Rick Waldron wrote:
> On Sunday, December 8, 2013, Hemanth H.M wrote:
>
>     Ah! Sweet :)
>
>     Makes sense of why send() method was implemented for generators.
>
>
> send(value) was removed in favor of next(value)

Thanks for reminding me -- the SpiderMonkey (after Python) split of send 
from next reflects the evolution in Python of yield from a statement 
form into an expression form (to which one sends values), combined with 
Python's strict arity checking (next takes 0 args, send takes 1). At 
least, that's my understanding.

ES6 has no reason not to unify send with next, so we did -- along with 
axing StopIteration in favor of a functional (record returning) style, 
which engines will have to optimize (not hard, but nothing's free) to 
avoid allocation per user-coded iterator next().

/be
domenic at domenicdenicola.com (2013-12-18T03:40:01.818Z)
Rick Waldron wrote:
> send(value) was removed in favor of next(value)

Thanks for reminding me -- the SpiderMonkey (after Python) split of send 
from next reflects the evolution in Python of yield from a statement 
form into an expression form (to which one sends values), combined with 
Python's strict arity checking (next takes 0 args, send takes 1). At 
least, that's my understanding.

ES6 has no reason not to unify send with next, so we did -- along with 
axing StopIteration in favor of a functional (record returning) style, 
which engines will have to optimize (not hard, but nothing's free) to 
avoid allocation per user-coded iterator next().