Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-12-03 Thread Cheyo Jose Jimenez via swift-evolution
> On Dec 3, 2017, at 12:44 PM, Jean-Daniel wrote: > > > >> Le 3 déc. 2017 à 09:29, Jose Cheyo Jimenez > > a écrit : >> >> >> >> On Dec 2, 2017, at 11:46 PM, Jean-Daniel >

Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-12-03 Thread Jean-Daniel via swift-evolution
> Le 3 déc. 2017 à 09:29, Jose Cheyo Jimenez a écrit : > > > > On Dec 2, 2017, at 11:46 PM, Jean-Daniel > wrote: > >> >> >>> Le 3 déc. 2017 à 04:58, Jose Cheyo Jimenez via swift-evolution >>>

Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-12-03 Thread Chris Lattner via swift-evolution
> On Dec 2, 2017, at 7:58 PM, Jose Cheyo Jimenez wrote: > > Hi Chis, > > Thank you for pushing this forward. > > My only comment is that on the declaration side it would be great to also > have an attribute to communicate that compiler magic is happening. > >

Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-12-03 Thread Jose Cheyo Jimenez via swift-evolution
> On Dec 2, 2017, at 11:46 PM, Jean-Daniel wrote: > > > >> Le 3 déc. 2017 à 04:58, Jose Cheyo Jimenez via swift-evolution >> a écrit : >> >> Hi Chris, >> >> Thank you for pushing this forward. >> >> My only comment is that on the

Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-12-02 Thread Jean-Daniel via swift-evolution
> Le 3 déc. 2017 à 04:58, Jose Cheyo Jimenez via swift-evolution > a écrit : > > Hi Chis, > > Thank you for pushing this forward. > > My only comment is that on the declaration side it would be great to also > have an attribute to communicate that compiler magic

Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-12-02 Thread Jose Cheyo Jimenez via swift-evolution
Hi Chis, Thank you for pushing this forward. My only comment is that on the declaration side it would be great to also have an attribute to communicate that compiler magic is happening. Currently it is surprising that a regular looking protocol is providing me so much power. Suggestions:

Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-11-29 Thread Richard Wei via swift-evolution
> On Nov 29, 2017, at 07:25, Chris Lattner via swift-evolution > wrote: > > >> On Nov 29, 2017, at 12:46 AM, Brent Royal-Gordon >> wrote: >> >>> On Nov 28, 2017, at 8:35 PM, Chris Lattner wrote: >>> >>> We’ve had a

Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-11-29 Thread Chris Lattner via swift-evolution
> On Nov 29, 2017, at 12:46 AM, Brent Royal-Gordon > wrote: > >> On Nov 28, 2017, at 8:35 PM, Chris Lattner wrote: >> >> We’ve had a lot of discussions over the years about how to balance >> simplicity vs power, implicitness vs explicitness,

Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-11-29 Thread Chris Lattner via swift-evolution
> On Nov 29, 2017, at 2:21 AM, Jonathan Hull wrote: > > I noticed all of the examples return the same type as they are defined on > (JSON has a subscript that returns JSON). Is there an example of where this > is not the case? Yes, they exist, there is one in the Python

Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-11-29 Thread Jonathan Hull via swift-evolution
I noticed all of the examples return the same type as they are defined on (JSON has a subscript that returns JSON). Is there an example of where this is not the case? > On Nov 25, 2017, at 3:16 PM, Chris Lattner via swift-evolution > wrote: > > On Nov 20, 2017,

Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-11-29 Thread Brent Royal-Gordon via swift-evolution
> On Nov 28, 2017, at 8:35 PM, Chris Lattner wrote: > > We’ve had a lot of discussions over the years about how to balance simplicity > vs power, implicitness vs explicitness, intentionality vs accidental > behavior, etc. For example, in very early discussions about Swift

Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-11-28 Thread Chris Lattner via swift-evolution
> On Nov 27, 2017, at 7:31 PM, Xiaodi Wu wrote: > > Better yet, since we previously started to require “@objc dynamic” instead of > “dynamic” with the notion that perhaps there would be some future non-ObjC > dynamism, we *could* have it spelt “dynamic member(_:)”. I’m

Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-11-28 Thread Chris Lattner via swift-evolution
> On Nov 27, 2017, at 6:21 PM, Brent Royal-Gordon > wrote: > >> On Nov 25, 2017, at 3:16 PM, Chris Lattner via swift-evolution >> > wrote: >> >> Just to talk to myself a bit here, but I’ve come to realize

Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-11-27 Thread Xiaodi Wu via swift-evolution
Better yet, since we previously started to require “@objc dynamic” instead of “dynamic” with the notion that perhaps there would be some future non-ObjC dynamism, we *could* have it spelt “dynamic member(_:)”. But this is all just spelling now; I think the overall design is compelling in its

Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-11-27 Thread Brent Royal-Gordon via swift-evolution
> On Nov 25, 2017, at 3:16 PM, Chris Lattner via swift-evolution > wrote: > > Just to talk to myself a bit here, but I’ve come to realize that the right > design really is to have a simple empty marker protocol like this: If you're reaching this point. why have a

Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-11-25 Thread Chris Lattner via swift-evolution
On Nov 20, 2017, at 10:36 PM, Chris Lattner wrote: > Hi all, > > I’ve significantly revised the ‘dynamic member lookup’ pitch, here’s the > second edition: > https://gist.github.com/lattner/b016e1cf86c43732c8d82f90e5ae5438 > > I’ve incorporated some minor changes to it: >

Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-11-21 Thread David Hart via swift-evolution
I’m very happy with this new version of the proposal. Splitting into two protocols makes a lot of sense - the JSON example alone is argument enough. To bike-shedding: while I understand the need to keep the identifier names verbose, I would prefer the subscript label to be more representative

[swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-11-20 Thread Chris Lattner via swift-evolution
Hi all, I’ve significantly revised the ‘dynamic member lookup’ pitch, here’s the second edition: https://gist.github.com/lattner/b016e1cf86c43732c8d82f90e5ae5438 I’ve incorporated some minor changes to it: - I’ve made it possible to provide read-only dynamic members. - I’ve added an example