Re: Proposal: syntactic sugar for extracting fields from objects

2019-05-29 Thread guest271314
> I think it's possible to find someone who will represent the will of community. Individuals can compose the code right now. > At the moment the question is does community have will to add proposed sugar to the language, and if so, which version. Why would there be any restriction on the

Re: Proposal: syntactic sugar for extracting fields from objects

2019-05-29 Thread Григорий Карелин
True I think it's possible to find someone who will represent the will of community. At the moment the question is does community have will to add proposed sugar to the language, and if so, which version. ср, 29 мая 2019 г. в 22:30, Oriol _ : > If you want to add this you will need a champion,

Re: Proposal: syntactic sugar for extracting fields from objects

2019-05-29 Thread Oriol _
If you want to add this you will need a champion, see https://github.com/tc39/ecma262/blob/master/CONTRIBUTING.md#new-feature-proposals -- Oriol El 29/5/19 a les 21:15, Григорий Карелин ha escrit: I agree. So, what does community think? Do we want to have “destructuring picking” sugar in JS

Re: Proposal: syntactic sugar for extracting fields from objects

2019-05-29 Thread Григорий Карелин
I agree. So, what does community think? Do we want to have “destructuring picking” sugar in JS and if we do, which syntax looks more attractive? I’d suggest to vote. On Wed, 29 May 2019 at 21:55, Bob Myers wrote: > This syntax merely combines and extends two existing notations: > > 1. Dot

Re: Proposal: syntactic sugar for extracting fields from objects

2019-05-29 Thread Bob Myers
This syntax merely combines and extends two existing notations: 1. Dot notation to access properties, which has been in JS since it was initially designed, with the RHS extended to permit a *set* of properties in `{}` in addition to a plain old identifier as at present. 2. Property spread

Re: Proposal: syntactic sugar for extracting fields from objects

2019-05-29 Thread Григорий Карелин
Well, I guess it might work too. I personally like more verbose constructions, with keywords instead of dots, asterisks, etc :) On Wed, 29 May 2019 at 21:03, Bob Myers wrote: > On Wed, May 29, 2019 at 10:28 AM Григорий Карелин > wrote: > >> Hi Cyril, >> With the syntax you propose what would

Re: Proposal: syntactic sugar for extracting fields from objects

2019-05-29 Thread Bob Myers
On Wed, May 29, 2019 at 10:28 AM Григорий Карелин wrote: > Hi Cyril, > With the syntax you propose what would be the way to to this: > ``` > const source = {foo: 1, bar: 2}; > const result = {foo: source.foo, bar: source.bar, buzz: 3} > ``` > ? > As already mentioned earlier in this thread:

Re: Proposal: syntactic sugar for extracting fields from objects

2019-05-29 Thread Григорий Карелин
Hi Cyril, With the syntax you propose what would be the way to to this: ``` const source = {foo: 1, bar: 2}; const result = {foo: source.foo, bar: source.bar, buzz: 3} ``` ? ср, 29 мая 2019 г. в 20:14, Cyril Auburtin : > What I'd like is this syntax: > > ```js > let o={a:1, b:2, c:3}; > o.{a, b}

Re: Proposal: syntactic sugar for extracting fields from objects

2019-05-29 Thread Cyril Auburtin
What I'd like is this syntax: ```js let o={a:1, b:2, c:3}; o.{a, b} // would be {a: 1, b: 2} ``` On Tue, May 28, 2019 at 9:13 PM Григорий Карелин wrote: > Here are another examples, where "destructuring picking" I suggest whould > be helpful. > ==1A Now (redux related) > ``` > function