Re: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-04 Thread Andrea Giammarchi
You are right, I've realized it after posting ... `Object.assign(target, source)` via `Get` and `Put` is basically the equivalent of a classic `for/in` with `hasOwnProperty` check ... well, once again, in ES6 `Object.getOwnPropertyDescriptors(O)` seems to be a solution for other cases too (shallow

Re: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-04 Thread Claude Pache
> Le 5 mars 2014 à 00:18, Andrea Giammarchi a > écrit : > > > Also please note that this proposal simplifies [Object.assign(target, > source)](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) > too since latter one is basically: > > ```javascript > Object.defineProp

Re: ES6 Tasks and TaskQueues

2014-03-04 Thread Brendan Eich
Tom Van Cutsem wrote: By contrast, terms such as "task" are used much more broadly (e.g. tasks scheduled on a thread pool). Yes, and a Task (e.g., in Rust; akin to goroutine in Go or Process in Erlang) can be suspended voluntarily. The use of "task" goes way back (multi-tasking). I think we

Re: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-04 Thread Andrea Giammarchi
"thing" ... no "things", just this one ... pliz :-) Also please note that this proposal simplifies [Object.assign(target, source)]( https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) too since latter one is basically: ```javascript Object.defineProperties( target,

Re: ES6 Tasks and TaskQueues

2014-03-04 Thread Claude Pache
> Le 4 mars 2014 à 19:47, "Mark S. Miller" a écrit : > >> On Tue, Mar 4, 2014 at 10:39 AM, Tab Atkins Jr. wrote: >> On Tue, Mar 4, 2014 at 5:59 AM, Claude Pache wrote: >> > Le 24 févr. 2014 à 19:40, Allen Wirfs-Brock a >> > écrit : >> >> I don't think this use of the word "turn" is broadly

Re: ES6 Tasks and TaskQueues

2014-03-04 Thread Rick Waldron
On Tue, Mar 4, 2014 at 2:03 PM, Tom Van Cutsem wrote: > The benefit of "turn" is that I've seen this terminology used almost > exclusively for denoting an atomic turn of an event loop ("tick" is also > often used). > I was drafting a response that said exactly this, came back from lunch and Tom'

Re: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-04 Thread Rick Waldron
On Tue, Mar 4, 2014 at 2:40 PM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > Allen, as developer, being unable to `shallow-copy` in JavaScript for > other *N* years is actually critical. > > Luckily it's not so difficult to polyfill but if you have Rick presenting > [something like th

Re: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-04 Thread Andrea Giammarchi
Allen, as developer, being unable to `shallow-copy` in JavaScript for other *N* years is actually critical. Luckily it's not so difficult to polyfill but if you have Rick presenting [something like this]( https://gist.github.com/WebReflection/9353781#objectgetownpropertydescriptorso) I really hope

Re: ES6 Tasks and TaskQueues

2014-03-04 Thread Allen Wirfs-Brock
On Mar 4, 2014, at 11:03 AM, Tom Van Cutsem wrote: > The benefit of "turn" is that I've seen this terminology used almost > exclusively for denoting an atomic turn of an event loop ("tick" is also > often used). By contrast, terms such as "task" are used much more broadly > (e.g. tasks schedul

Re: ES6 Tasks and TaskQueues

2014-03-04 Thread Tab Atkins Jr.
On Tue, Mar 4, 2014 at 10:47 AM, Mark S. Miller wrote: > On Tue, Mar 4, 2014 at 10:39 AM, Tab Atkins Jr. > wrote: >> >> On Tue, Mar 4, 2014 at 5:59 AM, Claude Pache >> wrote: >> > Le 24 févr. 2014 à 19:40, Allen Wirfs-Brock a >> > écrit : >> >> I don't think this use of the word "turn" is broad

Re: ES6 Tasks and TaskQueues

2014-03-04 Thread Tom Van Cutsem
The benefit of "turn" is that I've seen this terminology used almost exclusively for denoting an atomic turn of an event loop ("tick" is also often used). By contrast, terms such as "task" are used much more broadly (e.g. tasks scheduled on a thread pool). Just my 2c. 2014-03-04 19:47 GMT+01:00 M

Re: ES6 Tasks and TaskQueues

2014-03-04 Thread Mark S. Miller
On Tue, Mar 4, 2014 at 10:39 AM, Tab Atkins Jr. wrote: > On Tue, Mar 4, 2014 at 5:59 AM, Claude Pache > wrote: > > Le 24 févr. 2014 à 19:40, Allen Wirfs-Brock a > écrit : > >> I don't think this use of the word "turn" is broadly enough known to > provide many spec. readers an immediate intuitive

Re: ES6 Tasks and TaskQueues

2014-03-04 Thread Tab Atkins Jr.
On Tue, Mar 4, 2014 at 5:59 AM, Claude Pache wrote: > Le 24 févr. 2014 à 19:40, Allen Wirfs-Brock a écrit : >> I don't think this use of the word "turn" is broadly enough known to provide >> many spec. readers an immediate intuitive feeling for the concept. > > It seems to me that the word "turn

Re: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-04 Thread Allen Wirfs-Brock
On Mar 4, 2014, at 10:17 AM, Rick Waldron wrote: >> > > I like this cloning idiom, but I don't see why we would consider this for > ES6, it isn't something that is critical or can't be implemented via ES code. > It would be much more appropriate to queue it up for the 2015 train. > > ES6: l

Re: typed arrays

2014-03-04 Thread Boris Zbarsky
On 3/4/14 1:21 PM, C. Scott Ananian wrote: There's no benefit to the implementor in differentiating the function objects There is: You don't have to have extra machinery to stash a copy of the function object somewhere when it first gets created so you can ensure that the same object ends up

Re: typed arrays

2014-03-04 Thread C. Scott Ananian
On Tue, Mar 4, 2014 at 12:23 PM, Allen Wirfs-Brock wrote: > There's actually a big difference between %TypedArray%.from and Array.from. > The typed array version must accurately determine the number of elements in > the new array be instantiating it. The regular array can pre-instantiate > the ne

Re: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-04 Thread Andrea Giammarchi
this boilerplate is error prone and prolix plus it cannot be optimized in core so it's also very slow. With the introduction of classes, Symbols, and all ES6 new entries, I feel like the `for(var key in object)` loop is dead but developers have no way to clone objects in the right way and in one s

Re: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-04 Thread Rick Waldron
On Tue, Mar 4, 2014 at 1:03 PM, Allen Wirfs-Brock wrote: > > On Mar 4, 2014, at 9:34 AM, Rick Waldron wrote: > > > > > On Tue, Mar 4, 2014 at 12:30 PM, Andrea Giammarchi < > andrea.giammar...@gmail.com> wrote: > >> Apparently this triggered an @rwaldron which seems to be super-effective >> >> In

Re: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-04 Thread Andrea Giammarchi
I mixed up ... sorry, let me recap: 1. `Object.getOwnPropertyNames(O)` list of `properties` and `Object.getOwnPropertySymbols(O)` list of `Symbols` can be both used, per each item of each list, with `Object.getOwnPropertyDescriptor(O, propertyOrSymbol)` 2. `Object.getOwnPropertyDesc

Re: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-04 Thread Allen Wirfs-Brock
On Mar 4, 2014, at 9:34 AM, Rick Waldron wrote: > > > > On Tue, Mar 4, 2014 at 12:30 PM, Andrea Giammarchi > wrote: > Apparently this triggered an @rwaldron which seems to be super-effective > > In agenda for April's meeting. > > Yep: https://github.com/tc39/agendas/blob/master/2014/04.md

Re: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-04 Thread Rick Waldron
On Tue, Mar 4, 2014 at 12:48 PM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > yes, because `Object.getOwnPropertyDescriptor(O, k)` accepts both > `propertyName` and `Symbol` as second argument. The plural, and to be > consistent with the shallowCopy example, should return a list of bo

Re: Loader and Module as globals?

2014-03-04 Thread Brendan Eich
John Barton wrote: Well we have to make a choice. If we use Loader.prototype.Module, then we'll get System.Module by way of System being instanceof Loader. I don't see any reply to this message, but Loader and Module go in Reflect, last I heard. What you were worrying about does not make sense

Re: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-04 Thread Andrea Giammarchi
yes, because `Object.getOwnPropertyDescriptor(O, k)` accepts both `propertyName` and `Symbol` as second argument. The plural, and to be consistent with the shallowCopy example, should return a list of both. This is also because all descriptors returned by `Object.getOwnPropertySymbols` can be used

Re: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-04 Thread Rick Waldron
Question: should the returned array include property descriptors for properties whose key is a symbol? Rick On Tue, Mar 4, 2014 at 12:34 PM, Rick Waldron wrote: > > > > On Tue, Mar 4, 2014 at 12:30 PM, Andrea Giammarchi < > andrea.giammar...@gmail.com> wrote: > >> Apparently this triggered an

Re: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-04 Thread Rick Waldron
On Tue, Mar 4, 2014 at 12:30 PM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > Apparently this triggered an @rwaldron which seems to be super-effective > > In agenda for April's meeting. > Yep: https://github.com/tc39/agendas/blob/master/2014/04.md Going to try, but it's so late in

RE: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-04 Thread Andrea Giammarchi
Apparently this triggered an @rwaldron which seems to be super-effective In agenda for April's meeting. Thanks Sent from my Windows Phone -- From: C. Scott Ananian Sent: 3/4/2014 6:16 To: Andrea Giammarchi Cc: es-discuss@mozilla.org list Subject: Re: Object.getO

Re: typed arrays

2014-03-04 Thread Allen Wirfs-Brock
On Mar 4, 2014, at 8:17 AM, C. Scott Ananian wrote: > While we're on the topic, let me bang the drum one last time for tweaking > some of the `Array` built-ins so that they can be applied to `TypedArray`s. > The fact that there are separate `Array.from` and `%TypedArray%.from` methods > in the

Re: ES6 Tasks and TaskQueues

2014-03-04 Thread Allen Wirfs-Brock
Mark, As I've already said, I can live with "Turn". It's big advantage is that it completely avoids confusion with the HTML Task/Micro-task concepts. Allen On Mar 4, 2014, at 8:24 AM, Mark S. Miller wrote: > On Mon, Mar 3, 2014 at 4:57 PM, Allen Wirfs-Brock > wrote: > > On Mar 3, 2014, at

Re: ES6 Tasks and TaskQueues

2014-03-04 Thread Mark S. Miller
On Tue, Mar 4, 2014 at 5:59 AM, Claude Pache wrote: > Le 24 févr. 2014 à 19:40, Allen Wirfs-Brock a > écrit : > > > > > I don't think this use of the word "turn" is broadly enough known to > provide many spec. readers an immediate intuitive feeling for the concept. > > It seems to me that the wo

Re: ES6 Tasks and TaskQueues

2014-03-04 Thread Mark S. Miller
On Mon, Mar 3, 2014 at 4:57 PM, Allen Wirfs-Brock wrote: > > On Mar 3, 2014, at 4:32 PM, Mark S. Miller wrote: > > Is "chore" better than "turn"? > > Mark, to me "turn", as a noun, sounds like a "scheduling slot" rather than > the thing that gets scheduled into the slot. For example: "in the next

Re: ES6 Tasks and TaskQueues

2014-03-04 Thread Allen Wirfs-Brock
On Mar 3, 2014, at 10:04 PM, Brendan Eich wrote: > Allen Wirfs-Brock wrote: >> Now its just a word that we are assigning our own meaning to, so we can use >> "turn" if we want. But is that equivalence of "turn" and "task" really what >> you're used to, and something whose meaning is intuitive

Re: typed arrays

2014-03-04 Thread C. Scott Ananian
While we're on the topic, let me bang the drum one last time for tweaking some of the `Array` built-ins so that they can be applied to `TypedArray`s. The fact that there are separate `Array.from` and `%TypedArray%.from` methods in the spec (for example) makes me sad. IIRC all that is needed in `Arr

Re: ES6 Tasks and TaskQueues

2014-03-04 Thread Claude Pache
Le 24 févr. 2014 à 19:40, Allen Wirfs-Brock a écrit : > > I don't think this use of the word "turn" is broadly enough known to provide > many spec. readers an immediate intuitive feeling for the concept. It seems to me that the word "turn" is widely used in that sense for turned-based games s