Re: Why using the size property in set
yes in fact it makes sens because Set.length is the property of Set, not necessary the length of the collection. Thanks for your answers :) 2014-07-31 17:12 GMT+02:00 Allen Wirfs-Brock al...@wirfs-brock.com: This was intentional Allen On Jul 31, 2014, at 5:24 AM, Nathan Wall ww...@google.com wrote: Also, whether this was intentional or not, I think it's nice for objects with `length` properties to all have properties at indices from `0` to `length` (so they work in the `Array.prototype` methods) making `'length' in foo` a lazy-man's `isArrayLike`. ```js var forEach = Function.prototype.call.bind(Array.prototype.forEach); forEach('foo', function(u) { console.log(u); }); ``` On Thu, Jul 31, 2014 at 7:21 AM, David Bruant bruan...@gmail.com wrote: Le 31/07/2014 09:25, Maxime Warnier a écrit : Hi everybody, I was reading the doc for the new Set method and something suprised me : Why Set uses the size method instead of the length property ? IIRC and with my own words length refers more to something that can be measured contiguously (like a distance or a number of allocated bytes, etc.) while size doesn't have this contiguous aspect to it. David ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -- Maxime WARNIER ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
Why using the size property in set
Hi everybody, I was reading the doc for the new Set method and something suprised me : Why Set uses the size method instead of the length property ? -- Maxime WARNIER ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
Re: ES6 talk slides
Your link seems to be broken ;) 2014-07-09 17:41 GMT+02:00 Mark Volkmann r.mark.volkm...@gmail.com: Here's a link to my slides from a recent talk I gave on ES6. I thought some on this list my find it interesting and others might send me corrections. ;-) http://sett.ociweb.com/sett/settJul2014.html -- R. Mark Volkmann Object Computing, Inc. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -- Maxime WARNIER ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
Re: ES6 talk slides
It's working now. Strange.. anyway, thanks :) 2014-07-09 20:33 GMT+02:00 Mark Volkmann r.mark.volkm...@gmail.com: Are you sure? I just tried it and it worked for me. On Wed, Jul 9, 2014 at 1:23 PM, Maxime Warnier mar...@gmail.com wrote: Your link seems to be broken ;) 2014-07-09 17:41 GMT+02:00 Mark Volkmann r.mark.volkm...@gmail.com: Here's a link to my slides from a recent talk I gave on ES6. I thought some on this list my find it interesting and others might send me corrections. ;-) http://sett.ociweb.com/sett/settJul2014.html -- R. Mark Volkmann Object Computing, Inc. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -- Maxime WARNIER -- R. Mark Volkmann Object Computing, Inc. -- Maxime WARNIER ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
Re: Object copy
Thanks for your answers. Object.assign seems good but provides only copy for enumerable properties, not a real deep clone. I know for jquery, that's why i precised only for DOM but it was just to show the syntax :) 2014-06-11 0:00 GMT+02:00 Rick Waldron waldron.r...@gmail.com: On Tue, Jun 10, 2014 at 12:32 PM, Maxime Warnier mar...@gmail.com wrote: Hi All Do you know if it is planned or maybe in discussion for ES7 to have a simple clone system on objects ? There are different notations, from : - jquery Object.clone( [withDataAndEvents ] [, deepWithDataAndEvents ] ) jQuery doesn't clone objects, it clones DOM elements. Rick -- Maxime ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
Re: Object copy
Hi David :) thanks for the links ! You are right, it's generally about data. Serialize an object to JSON prevent from sharing references. On the twitter feed Jeremy talks about optimizing the process . I'm agree with that, for performance and a nicer syntax. By the way, the Object.deepFreeze is really interesting , especially for an API and when you want to set some private properties . But I think it is a workaround to the issue of cloning because you can't freeze all objects and maybe you want to have a mutable object but cloning it afterward. 2014-06-11 9:58 GMT+02:00 David Bruant bruan...@gmail.com: Hi Maxime, Good to see you here :-) This topic has been discussed recently on Twitter. See https://twitter.com/jeremyckahn/status/474259042005553154 I'm like Rick's answer in particular https://twitter.com/rwaldron/status/475017360085364736 as I believe a large share of cloning is just about data As discussed in this Twitter thread, immutable data structures would be an interesting idea too. If an object is guaranteed to be deeply immutable, then, it can be passed around without the need for cloning. Clones are only necessary because the initial object is mutable in the first place. Immutable data structures have been briefly discussed here recently: https://mail.mozilla.org/pipermail/es-discuss/2014-June/037429.html (see replies too) David Le 11/06/2014 08:49, Maxime Warnier a écrit : Thanks for your answers. Object.assign seems good but provides only copy for enumerable properties, not a real deep clone. I know for jquery, that's why i precised only for DOM but it was just to show the syntax :) 2014-06-11 0:00 GMT+02:00 Rick Waldron waldron.r...@gmail.com: On Tue, Jun 10, 2014 at 12:32 PM, Maxime Warnier mar...@gmail.com wrote: Hi All Do you know if it is planned or maybe in discussion for ES7 to have a simple clone system on objects ? There are different notations, from : - jquery Object.clone( [withDataAndEvents ] [, deepWithDataAndEvents ] ) jQuery doesn't clone objects, it clones DOM elements. Rick -- Maxime WARNIER ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
Object copy
Hi All Do you know if it is planned or maybe in discussion for ES7 to have a simple clone system on objects ? There are different notations, from : - jquery Object.clone( [withDataAndEvents ] [, deepWithDataAndEvents ] ) ( but only for DOM element ) - underscore _.clone(object) ( return the cloned object ) - angular angular.copy(source, [destination]); (return the object, same as underscore, or copy into an optional destination ) Maybe an Object.copy([options?]) would be interesting ? Maxime Maxime Warnier @maxdow ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss