On Thu, Jul 11, 2013 at 7:37 PM, Andrea Giammarchi <
[email protected]> wrote:

> 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.
>

When were these ever arrays? Here's their first appearance, this revision:
http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets&rev=1339969786


Either way, all you need to do is stop treating the _proposal_ as a
normative specification and start using the actual spec as a reference and
this isn't a problem. Here's what I do: whenever I need to refresh on
something ES6 related, I look at Allen's _latest_ draft first—usually the
one with the change markup (this is useful, because Allen regularly leaves
notes about the changes). If I can't find what I'm looking for, then I look
at my meeting notes. If I'm still unable to find the answer, then the very
last place I look is at the proposal. I find this approach greatly reduces
my need to post messages of outrage to mailing list.


Rick



> 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
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to