Why do generator expressions return generators?

Domenic Denicola domenic at domenicdenicola.com
Fri Sep 6 09:06:38 PDT 2013

From: Brendan Eich [brendan at mozilla.com]

> The spec does not use desugaring, of course. While it could be done, in a debugger the results would differ observably from a generator function with let bindings. I think the spec should talk about this level of observability.

Hmm, getting somewhere here. Could you expand on this? E.g. give a code example where the observable results would be different if it returned a iteratable-iterator instead of a generator?

More information about the es-discuss mailing list