instantiating generators

Jason Orendorff jason.orendorff at
Fri Mar 15 15:53:29 PDT 2013

On Fri, Mar 15, 2013 at 11:22 AM, Axel Rauschmayer <axel at> wrote:

> I would prefer having to use `new` (but don’t have strong feelings about
> it): generators are more like constructors than like functions. When I
> first started experimenting with them in Firefox, it took me a while to
> figure that out (even though it is obvious in hindsight). With `new`, I’d
> probably have figured it out quicker.

I agree with Tab: I wonder if your mental model for generators might not
continue to evolve.

I would hate to have to write:
    for (k of new tree.preorder())
rather than:
    for (k of tree.preorder())

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list