Iterators, generators, finally, and scarce resources (Was: April 10 2014 Meeting Notes)
dherman at mozilla.com
Tue Apr 29 16:19:19 PDT 2014
On Apr 29, 2014, at 12:17 PM, Domenic Denicola <domenic at domenicdenicola.com> wrote:
> Anyway, regardless of the specifics of my `using` proposal, I hope that highlighting the iterability vs. disposability aspects of this conversation was helpful to people.
I do think it's helpful for understanding the space, thanks.
But here's why I don't think it ultimately helps: we are going to need combinators for iterators, and they are going to have to make the same decision. We aren't going to have e.g. map and mapDispose. I still contend that the common case is that iterators are short-lived, and the language should safely ensure they are disposed of. So the combinators should ensure that their underlying iterator is disposed of, and for-of should behave consistently with the combinators.
More information about the es-discuss