Rick Waldron (2013-06-28T00:37:13.000Z)
On Thu, Jun 27, 2013 at 8:30 PM, Tab Atkins Jr. <jackalmage at gmail.com>wrote:

> On Thu, Jun 27, 2013 at 5:26 PM, Rick Waldron <waldron.rick at gmail.com>
> wrote:
> > On Thu, Jun 27, 2013 at 8:11 PM, Tab Atkins Jr. <jackalmage at gmail.com>
> > wrote:
> >> In particular, I like that it just returns the modified map/set, so
> >> it's easy to chain with, or to immediately return.
> >
> > I was wondering about this while reading your OP, but you're not
> returning
> > anything in that "desugaring". Anyway, I agree with this reasoning.
>
> Whoops, I left that out accidentally.  Modified (also to use Allen's
> for-of rather than forEach):
>
> Map.prototype.update = function(iter) {
>   for([k,v] of iter) this.set(k,v);
>   return this;
> };
> Set.prototype.update = function(iter) {
>   for(v of iter) this.add(v);
>   return this;
> };
>

I agree with this and I think these should be added to the pool of methods
to consider for Map and Set. The "pool" I refer to includes, but is not
limited to:

- union
- intersect
- difference
- update (as of now)

Rick



>
> ~TJ
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130627/97314461/attachment-0001.html>
github at esdiscuss.org (2013-07-12T02:27:37.681Z)
On Thu, Jun 27, 2013 at 8:30 PM, Tab Atkins Jr. <jackalmage at gmail.com>wrote:

> Whoops, I left that out accidentally.  Modified (also to use Allen's
> for-of rather than forEach):

I agree with this and I think these should be added to the pool of methods
to consider for Map and Set. The "pool" I refer to includes, but is not
limited to:

- union
- intersect
- difference
- update (as of now)