Re: Proposal: Property Accessor Function Shorthand

2019-12-09 Thread Tab Atkins Jr.
On Sat, Dec 7, 2019 at 2:01 PM wrote: >> I do find it surprising that property access isn't addressed there, >> but it seems like it was likely just overlooked - it has no mention in >> the repo, in the open issues, or even in the closed issues or any of >> the open or closed pull requests. > >

Re: Proposal: Property Accessor Function Shorthand

2019-12-07 Thread sup
> > > I do find it surprising that property access isn't addressed there, > > > but it seems like it was likely just overlooked - it has no mention in > > > the repo, in the open issues, or even in the closed issues or any of > > > the open or closed pull requests. Actually, they do seem to

Re: Proposal: Property Accessor Function Shorthand

2019-12-07 Thread Bob Myers
Can you clarify in what sense you see this as a special case of that proposal? To put it in very simple terms, we would like to do something like `array.map(.name)`. On Tue, Dec 3, 2019 at 3:33 AM Isiah Meadows wrote: > BTW, all this is very much just a special case of this (existing stage > 1)

Re: Proposal: Property Accessor Function Shorthand

2019-12-03 Thread Isiah Meadows
BTW, all this is very much just a special case of this (existing stage 1) proposal, and is part of why it exists: https://github.com/tc39/proposal-partial-application I do find it surprising that property access isn't addressed there, but it seems like it was likely just overlooked - it has no

Re: Proposal: Property Accessor Function Shorthand

2019-12-03 Thread Michael Luder-Rosefield
At the cost of adding more code, but giving more power, perhaps what we want is something akin to Kotlin's `it` keyword: https://kotlinlang.org/docs/reference/lambdas.html?_ga=2.238822404.500195435.1575368476-1345353619.1575368476#it-implicit-name-of-a-single-parameter *it: implicit name of a

Re: Proposal: Property Accessor Function Shorthand

2019-12-02 Thread Waldemar Horwat
On 11/24/19 9:17 PM, Bob Myers wrote: FWIW, the syntax `.propName` does appear to be syntactically unambiguous. It conflicts with contextual keywords such as `new . target`. Waldemar ___ es-discuss mailing list es-discuss@mozilla.org

Re: Proposal: Property Accessor Function Shorthand

2019-11-25 Thread sup
To be clear, the `. * 2` example is an exaggeration. It’d be logical to restrict it to (Optional)MemberExpressions but my point is that I think what you’re allowed to do with it is not obvious. I think this is why Elm doesn’t support it. -- Agustín Zubiaga On Nov 25, 2019, 12:54 PM -0500,

Re: Proposal: Property Accessor Function Shorthand

2019-11-25 Thread sup
Hi Bob! I’m glad you like the proposal! > Using `.a` to denote a function to retrieve the value of the property named > `a` was actually part of an earlier proposal for a number of ways to extend > dot notation. I won't link to that proposal since it's obsolete now, but it > also allowed > >

Re: Proposal: Property Accessor Function Shorthand

2019-11-24 Thread Bob Myers
This is a great proposal which I hope can attract the support of the powers that be. The arrival of optional chaining seems to indicate a renewed interest in optimizing the way properties are accessed--which after all is a big part of what JS does for a living. Using `.a` to denote a function to

Proposal: Property Accessor Function Shorthand

2019-11-24 Thread sup
Hi folks! I'd like to hear your feedback on a proposal idea I have and that I couldn't find anything on. Here is what I have so far. With the rising popularity of functional programming patterns in JavaScript, functions that take an object and return the value of a property are ubiquitous.