Everybody should probably review esdiscuss.org/topic/why-do-generator-expressions-return-generators where we discussed this before.

which suggests using generator expressions as arrow bodies to make
generator functions with arrows

   () => (for (y of gen) y)

What I don't understand is why generator expressions are not used
as the only way to create generators, leaving 'function' alone. There
would be

- comprehension-style generator expressions, with implicit yield
    (for (...) ...)

- block-style generator expressions, with explicit yield
    (do*{ ... yield value ... })

and generator functions would be build from generator expressions
and functions (arrows or classic). No need to mix up functions and
generators. At least none I can see...

Claus


_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to