On Thu, Jul 11, 2013 at 4:06 PM, Andrea Giammarchi
<[email protected]> wrote:
> yes, I should have checked the specs but that page should be either updated
> or removed.
>
> Anyway you still didn't convince me generators were needed at all there,
> neither that I can "simply shim iterators" 'cause this makes generators
> pointless in first place if it was so easy to polyfill ... which is not.

I still have no idea what your problem with this is.  Your objections
aren't making any sense.

In general, generators are very hard to polyfill.  (Not impossible, as
you can do a CPS transform of the source code, but very difficult.)

This is not the general case, this is a very simple specific case.
You just need a trivial little iterator that runs over the internal
data structure of the Map/Set.  I've written these kinds of things
tons of times for classes in PHP, so they can work conveniently with
PHP foreach() loops.

That said, the reason the harmony page defined the methods with
generators is that, as easy as it is to write an iterator manually for
them, it's *even easier* to write them with a generator.  That's all.

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

Reply via email to