Check out Dart's iterators
Oliver Hunt
oliver at apple.com
Mon Feb 11 13:55:23 PST 2013
On Feb 11, 2013, at 1:33 PM, Jason Orendorff <jason.orendorff at gmail.com> wrote:
> On Mon, Feb 11, 2013 at 12:30 PM, Oliver Hunt <oliver at apple.com> wrote:
>
> For now I would say that we shouldn't expose the internal implementation behaviour of yield (which is what being able to explicitly create or call a generator produces). That fairly trivially resolves the StopIteration behaviour by pushing it out of the ES6 spec. If there's enough demand for manually creating or 'calling' a generator then we can fix it in ES6.x/7
>
> Can you be more concrete? Generator-iterators must at least be first-class values that can be created and then passed around.
I was meaning you don't have the ability to directly executing a generator - you can pass it around, hang properties of it, etc but not directly trigger enumeration
so you couldn't go generator.next() or generator() or whatever, but you could go for (... of generator) or [ ... generator], etc
> -j
--Oliver
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130211/44f60c5e/attachment-0001.html>
More information about the es-discuss
mailing list