// this doesn't work
   function* generator(){
       [1,2,3].forEach( function(x){ yield x } )
   }

I have been thinking and with for..of, I can't find a good reason to use
.forEach instead of for..of.
for..of does what you need here with generators too.

I've been looking at this example and thinking the same thing.

That's what you get for trying to use examples:-) long code doesn't
get read, short code is taken too seriously. As I said in my reply to
David, my point is not dependent on this example. Still, given the
readyness to abandon .forEach completely, it might be worthwhile to try and find a more realistic example, to see how big the damage is in practice.

Since we're talking about not completely implemented features, I don't have anything concrete yet, but perhaps in the direction of
other callback-based APIs? Is there a way to use generators to
enumerate directory trees in nodejs, or is it back to iterators?

Better examples welcome,
Claus

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to