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
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to