April 10 2014 Meeting Notes

Brendan Eich brendan at mozilla.org
Thu Apr 24 13:29:51 PDT 2014

Sorry for the confusion -- my "such a change" was about changing 
@@iterator itself, e.g. not defining it on a generator, or trying 
somehow to guarantee freshness.

I agree, return automation makes sense for any delimited form that 
implicitly calls @@iterator.

There still may be an open issue, though: Python has ref-counting and 
pre-mortem finalization via close, last I checked. JS won't have any 
such thing. So are there ,in ES6, undelimited forms that implicitly call 
@@iterator and that won't implicitly maybe-call return?


Jason Orendorff wrote:
> On Thu, Apr 24, 2014 at 2:16 PM, Brendan Eich<brendan at mozilla.org>  wrote:
>> >  The only proposal (let's table whether the name is 'return' or @@return) is
>> >  whether for-of constructs should have a finally maybe-call of the iterator's
>> >  return method, if present. Like SpiderMonkey's JS1.7-1.8 close method, based
>> >  in part on Python 2.5 and up.
> But in Python, closing iterators is part of the protocol. It isn't
> mentioned in the language specification (Python does not have a
> detailed spec) but all language and library facilities that consume
> iterables do it, not just for loops.

More information about the es-discuss mailing list