my problems is that generators were not needed there ... values() as array
of values, keys() as array of keys and items() as array of key/value pairs.

This is even **easier**

Generators because you wrote them in PHP ... this, is non sense to me (I am
zend certified engineer if you are wondering)

Anyway, problem solved: harmony pages and examples in them are outdated.




On Thu, Jul 11, 2013 at 4:33 PM, Tab Atkins Jr. <[email protected]>wrote:

> 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