Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-10-02 Thread David Hart via swift-evolution
> On 2 Oct 2017, at 06:39, Ted Kremenek via swift-evolution > wrote: > > >> On Oct 1, 2017, at 4:00 AM, Haravikk via swift-evolution >> mailto:swift-evolution@swift.org>> wrote: >> >>> >>> On 14 Sep 2017, at 20:10, Ben Rimmington >> > wrote: >>> >>> On

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-10-01 Thread Ted Kremenek via swift-evolution
> On Oct 1, 2017, at 4:00 AM, Haravikk via swift-evolution > wrote: > >> >> On 14 Sep 2017, at 20:10, Ben Rimmington wrote: >> >> >>> On 14 Sep 2017, at 15:31, Haravikk wrote: >>> On 14 Sep 2017, at 02:12, Xiaodi Wu wrote: > On Wed, Sep 13, 2017 at 09:13 Haravikk wrote:

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-10-01 Thread Haravikk via swift-evolution
> On 14 Sep 2017, at 20:10, Ben Rimmington wrote: > > >> On 14 Sep 2017, at 15:31, Haravikk wrote: >> >>> On 14 Sep 2017, at 02:12, Xiaodi Wu wrote: >>> On Wed, Sep 13, 2017 at 09:13 Haravikk wrote: I mean because not once have you summarised what these alleged "consider

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-14 Thread Ben Rimmington via swift-evolution
> On 14 Sep 2017, at 15:31, Haravikk wrote: > >> On 14 Sep 2017, at 02:12, Xiaodi Wu wrote: >> >>> On Wed, Sep 13, 2017 at 09:13 Haravikk wrote: >>> >>> I mean because not once have you summarised what these alleged >>> "considerations" were; if they exist then you should be able do so, yet al

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-14 Thread Haravikk via swift-evolution
> On 14 Sep 2017, at 02:12, Xiaodi Wu wrote: >> On Wed, Sep 13, 2017 at 09:13 Haravikk via swift-evolution >> mailto:swift-evolution@swift.org>> wrote: >> I mean because not once have you summarised what these alleged >> "considerations" were; if they exist then you should be able do so, yet al

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Xiaodi Wu via swift-evolution
On Wed, Sep 13, 2017 at 09:13 Haravikk via swift-evolution < swift-evolution@swift.org> wrote: > On 13 Sep 2017, at 03:26, Xiaodi Wu wrote: > > On Tue, Sep 12, 2017 at 11:43 AM, Haravikk via swift-evolution < > swift-evolution@swift.org> wrote: > >> >> On 12 Sep 2017, at 12:08, Xiaodi Wu wrote:

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Xiaodi Wu via swift-evolution
On Wed, Sep 13, 2017 at 06:20 Gwendal Roué wrote: > >> If I take on my free time exposing issues, it's because I hope that > maybe some reader will consider them with proper attention, then maybe > agree that there is an issue worth investigating, and then many conclude > that a made decision has

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread David Sweeris via swift-evolution
> On Sep 12, 2017, at 8:07 PM, Tony Allevato via swift-evolution > wrote: > > But all that stuff about custom attributes and metaprogramming introspection > is a big topic of it's own that isn't going to be solved in Swift 5, so this > is a bit of a digression. :) Is it really a digression,

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Tony Allevato via swift-evolution
On Wed, Sep 13, 2017 at 11:47 AM Vladimir.S wrote: > On 13.09.2017 20:48, Tony Allevato wrote: > > On Wed, Sep 13, 2017 at 10:21 AM Vladimir.S via swift-evolution > > mailto:swift-evolution@swift.org>> wrote: > > > > On 13.09.2017 19:08, Ondrej Barina via swift-evolution wrote: > > > May

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Nevin Brackett-Rozinsky via swift-evolution
On Wed, Sep 13, 2017 at 2:47 PM, Vladimir.S via swift-evolution < swift-evolution@swift.org> wrote: > > > As was noted in this thread, some people believe that protocol > synthesizing its requirements by accessing type's fields is of a different > kind than 'usual' protocol with default implementat

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Vladimir.S via swift-evolution
On 13.09.2017 20:48, Tony Allevato wrote: On Wed, Sep 13, 2017 at 10:21 AM Vladimir.S via swift-evolution mailto:swift-evolution@swift.org>> wrote: On 13.09.2017 19:08, Ondrej Barina via swift-evolution wrote: > Maybe something like this as middle ground. > > protocol Equatab

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Tony Allevato via swift-evolution
On Wed, Sep 13, 2017 at 10:21 AM Vladimir.S via swift-evolution < swift-evolution@swift.org> wrote: > On 13.09.2017 19:08, Ondrej Barina via swift-evolution wrote: > > Maybe something like this as middle ground. > > > > protocol Equatable { > > @syntetic static func ==(_ lhs: Self, _ rhs: Sel

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Tony Allevato via swift-evolution
On Wed, Sep 13, 2017 at 10:03 AM Vladimir.S wrote: > On 13.09.2017 19:03, Tony Allevato wrote: > > > > > > On Wed, Sep 13, 2017 at 8:41 AM Vladimir.S via swift-evolution > > mailto:swift-evolution@swift.org>> wrote: > > > > On 13.09.2017 7:14, Xiaodi Wu via swift-evolution wrote: > > > >

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Vladimir.S via swift-evolution
On 13.09.2017 15:34, Brent Royal-Gordon via swift-evolution wrote: On Sep 13, 2017, at 4:21 AM, Gwendal Roué via swift-evolution mailto:swift-evolution@swift.org>> wrote: If I take on my free time exposing issues, it's because I hope that maybe some reader will consider them with proper attent

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Vladimir.S via swift-evolution
On 13.09.2017 19:08, Ondrej Barina via swift-evolution wrote: Maybe something like this as middle ground. protocol Equatable { @syntetic static func ==(_ lhs: Self, _ rhs: Self) -> Bool } protocol itself contains default implementation, but without real body. Instead the function is marke

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Vladimir.S via swift-evolution
On 13.09.2017 19:03, Tony Allevato wrote: On Wed, Sep 13, 2017 at 8:41 AM Vladimir.S via swift-evolution mailto:swift-evolution@swift.org>> wrote: On 13.09.2017 7:14, Xiaodi Wu via swift-evolution wrote: > > On Tue, Sep 12, 2017 at 22:07 Tony Allevato mailto:tony.allev...@gmail

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Vladimir.S via swift-evolution
On 13.09.2017 17:13, Haravikk via swift-evolution wrote: Well, certainly, synthesized default implementations differ from non-synthesized ones in key respects. However, they do not differ in terms of the user experience of conforming to the protocol and having to override the default. Excep

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Ondrej Barina via swift-evolution
Maybe something like this as middle ground. protocol Equatable { @syntetic static func ==(_ lhs: Self, _ rhs: Self) -> Bool } protocol itself contains default implementation, but without real body. Instead the function is marked that the real body is generated by compiler. There is explicit m

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Tony Allevato via swift-evolution
On Wed, Sep 13, 2017 at 8:41 AM Vladimir.S via swift-evolution < swift-evolution@swift.org> wrote: > On 13.09.2017 7:14, Xiaodi Wu via swift-evolution wrote: > > > > On Tue, Sep 12, 2017 at 22:07 Tony Allevato > > wrote: > > > > On Tue, Sep 12, 2017 at 7:10 PM

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Vladimir.S via swift-evolution
On 13.09.2017 7:14, Xiaodi Wu via swift-evolution wrote: On Tue, Sep 12, 2017 at 22:07 Tony Allevato > wrote: On Tue, Sep 12, 2017 at 7:10 PM Xiaodi Wu mailto:xiaodi...@gmail.com>> wrote: On Tue, Sep 12, 2017 at 9:58 AM, Thorsten Seitz via swift-evo

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Haravikk via swift-evolution
> On 13 Sep 2017, at 03:26, Xiaodi Wu wrote: > > On Tue, Sep 12, 2017 at 11:43 AM, Haravikk via swift-evolution > mailto:swift-evolution@swift.org>> wrote: > >> On 12 Sep 2017, at 12:08, Xiaodi Wu > > wrote: >> >>> On Mon, Sep 11, 2017 at 06:03 Haravikk via swift-e

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Brent Royal-Gordon via swift-evolution
> On Sep 13, 2017, at 4:21 AM, Gwendal Roué via swift-evolution > wrote: > >>> If I take on my free time exposing issues, it's because I hope that maybe >>> some reader will consider them with proper attention, then maybe agree that >>> there is an issue worth investigating, and then many conc

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Gwendal Roué via swift-evolution
>> If I take on my free time exposing issues, it's because I hope that maybe >> some reader will consider them with proper attention, then maybe agree that >> there is an issue worth investigating, and then many conclude that a made >> decision has to be reverted. That's a multi-step process. An

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-13 Thread Xiaodi Wu via swift-evolution
On Wed, Sep 13, 2017 at 01:23 Gwendal Roué wrote: > > Le 13 sept. 2017 à 07:35, Xiaodi Wu a écrit : > > > On Wed, Sep 13, 2017 at 00:26 Gwendal Roué wrote: > >> >> Le 13 sept. 2017 à 06:28, Xiaodi Wu a écrit : >> >> >> On Tue, Sep 12, 2017 at 23:26 Gwendal Roué >> wrote: >> >>> >>> > Le 13 se

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Gwendal Roué via swift-evolution
> Le 13 sept. 2017 à 07:35, Xiaodi Wu a écrit : > > > On Wed, Sep 13, 2017 at 00:26 Gwendal Roué > wrote: > >> Le 13 sept. 2017 à 06:28, Xiaodi Wu > > a écrit : >> >> >> On Tue, Sep 12, 2017 at 23:26 Gwendal Roué >

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Xiaodi Wu via swift-evolution
On Wed, Sep 13, 2017 at 00:26 Gwendal Roué wrote: > > Le 13 sept. 2017 à 06:28, Xiaodi Wu a écrit : > > > On Tue, Sep 12, 2017 at 23:26 Gwendal Roué wrote: > >> >> > Le 13 sept. 2017 à 04:05, Xiaodi Wu a écrit : >> > >> > On Tue, Sep 12, 2017 at 2:30 PM, Gwendal Roué >> wrote: >> > >> In none

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Gwendal Roué via swift-evolution
> Le 13 sept. 2017 à 06:28, Xiaodi Wu a écrit : > > > On Tue, Sep 12, 2017 at 23:26 Gwendal Roué > wrote: > > > Le 13 sept. 2017 à 04:05, Xiaodi Wu > > a écrit : > > > > On Tue, Sep 12, 2017 at 2:30 PM, Gwendal Roué >

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Xiaodi Wu via swift-evolution
On Tue, Sep 12, 2017 at 23:26 Gwendal Roué wrote: > > > Le 13 sept. 2017 à 04:05, Xiaodi Wu a écrit : > > > > On Tue, Sep 12, 2017 at 2:30 PM, Gwendal Roué > wrote: > > >> In none of those cases, the compiler emits any warning. It's thus > easy to forget or miss the problem, and uneasy to fix i

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Gwendal Roué via swift-evolution
> Le 13 sept. 2017 à 04:05, Xiaodi Wu a écrit : > > On Tue, Sep 12, 2017 at 2:30 PM, Gwendal Roué wrote: > >> In none of those cases, the compiler emits any warning. It's thus easy to > >> forget or miss the problem, and uneasy to fix it (you'll need a runtime > >> failure to spot it, or a th

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Xiaodi Wu via swift-evolution
On Tue, Sep 12, 2017 at 22:07 Tony Allevato wrote: > On Tue, Sep 12, 2017 at 7:10 PM Xiaodi Wu wrote: > >> On Tue, Sep 12, 2017 at 9:58 AM, Thorsten Seitz via swift-evolution < >> swift-evolution@swift.org> wrote: >> >>> Good arguments, Tony, you have convinced me on all points. Transient is >>>

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Tony Allevato via swift-evolution
On Tue, Sep 12, 2017 at 7:10 PM Xiaodi Wu wrote: > On Tue, Sep 12, 2017 at 9:58 AM, Thorsten Seitz via swift-evolution < > swift-evolution@swift.org> wrote: > >> Good arguments, Tony, you have convinced me on all points. Transient is >> the way to go. Thank you for your patience! >> > > On many p

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Xiaodi Wu via swift-evolution
On Tue, Sep 12, 2017 at 11:43 AM, Haravikk via swift-evolution < swift-evolution@swift.org> wrote: > > On 12 Sep 2017, at 12:08, Xiaodi Wu wrote: > > On Mon, Sep 11, 2017 at 06:03 Haravikk via swift-evolution < > swift-evolution@swift.org> wrote: > >> See, this is another flawed assumption; you a

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Xiaodi Wu via swift-evolution
On Tue, Sep 12, 2017 at 9:58 AM, Thorsten Seitz via swift-evolution < swift-evolution@swift.org> wrote: > Good arguments, Tony, you have convinced me on all points. Transient is > the way to go. Thank you for your patience! > On many points, I agree with Tony, but I disagree that "transient" addr

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Xiaodi Wu via swift-evolution
On Tue, Sep 12, 2017 at 2:30 PM, Gwendal Roué wrote: > >> In none of those cases, the compiler emits any warning. It's thus easy > to forget or miss the problem, and uneasy to fix it (you'll need a runtime > failure to spot it, or a thorough code review). > >> > >> I hope you agree with this last

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread David Waite via swift-evolution
> On Sep 12, 2017, at 11:00 AM, Xiaodi Wu via swift-evolution > wrote: > > Suppose instead this were about a protocol named Fooable and a requirement > called foo() that has a default implementation. Everything you just talked > about would apply equally. Am I to understand that you are oppos

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Gwendal Roué via swift-evolution
>> In none of those cases, the compiler emits any warning. It's thus easy to >> forget or miss the problem, and uneasy to fix it (you'll need a runtime >> failure to spot it, or a thorough code review). >> >> I hope you agree with this last sentence. This unbalance between the >> easiness of th

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Vladimir.S via swift-evolution
On 12.09.2017 18:09, Tony Allevato wrote: On Tue, Sep 12, 2017 at 3:32 AM Vladimir.S > wrote: On 12.09.2017 0:35, Tony Allevato wrote: > > > On Mon, Sep 11, 2017 at 2:05 PM Vladimir.S via swift-evolution > mailto:swift-evolution@swift.org>

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Xiaodi Wu via swift-evolution
On Tue, Sep 12, 2017 at 09:53 Gwendal Roué wrote: > > > Le 12 sept. 2017 à 12:01, Xiaodi Wu a écrit : > > > >> There is this sample code by Thorsten Seitz with a cached property > which is quite simple and clear : > https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170911/039684.ht

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Haravikk via swift-evolution
> On 12 Sep 2017, at 16:29, Tony Allevato via swift-evolution > wrote: > > Since your game involves the specific question of a property that should not > be considered for Equatable synthesis, and since SE-0185 explicitly calls out > the notion of transient properties as a future direction to

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Haravikk via swift-evolution
> On 12 Sep 2017, at 12:08, Xiaodi Wu > wrote: > >> On Mon, Sep 11, 2017 at 06:03 Haravikk via swift-evolution >> mailto:swift-evolution@swift.org>> wrote: >> See, this is another flawed assumption; you are assuming that omitting a >> custom implementation of == is

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Vladimir.S via swift-evolution
On 12.09.2017 17:38, Tony Allevato wrote: On Mon, Sep 11, 2017 at 10:05 PM Gwendal Roué > wrote: This doesn't align with how Swift views the role of protocols, though. One of the criteria that the core team has said they look for in a protoco

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Gwendal Roué via swift-evolution
> Le 12 sept. 2017 à 17:26, Tony Allevato a écrit : > > Since your game involves the specific question of a property that should not > be considered for Equatable synthesis, and since SE-0185 explicitly calls out > the notion of transient properties as a future direction to solve that > speci

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Tony Allevato via swift-evolution
On Tue, Sep 12, 2017 at 8:10 AM Gwendal Roué wrote: > >> There is this sample code by Thorsten Seitz with a cached property > which is quite simple and clear : > https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170911/039684.html > >> > >> This is the sample code that had me enter

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Nevin Brackett-Rozinsky via swift-evolution
Tony makes an excellent point, and I agree. At some point in the future we should consider introducing a “transient” attribute for caches and other non-essential properties. That will make generated conformances more powerful while simultaneously reducing boilerplate. Nevin On Tue, Sep 12, 2017

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Gwendal Roué via swift-evolution
>> There is this sample code by Thorsten Seitz with a cached property which is >> quite simple and clear : >> https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170911/039684.html >> >> This is the sample code that had me enter the "worried" camp.' >> > I really like Thorsten's exa

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Tony Allevato via swift-evolution
On Tue, Sep 12, 2017 at 3:32 AM Vladimir.S wrote: > On 12.09.2017 0:35, Tony Allevato wrote: > > > > > > On Mon, Sep 11, 2017 at 2:05 PM Vladimir.S via swift-evolution > > mailto:swift-evolution@swift.org>> wrote: > > > > On 11.09.2017 21:55, Thorsten Seitz via swift-evolution wrote: > >

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Thorsten Seitz via swift-evolution
Good arguments, Tony, you have convinced me on all points. Transient is the way to go. Thank you for your patience! -Thorsten > Am 12.09.2017 um 16:38 schrieb Tony Allevato via swift-evolution > : > > > >> On Mon, Sep 11, 2017 at 10:05 PM Gwendal Roué wrote: > > This doesn't align

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Gwendal Roué via swift-evolution
> Le 12 sept. 2017 à 12:01, Xiaodi Wu a écrit : > >> There is this sample code by Thorsten Seitz with a cached property which is >> quite simple and clear : >> https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170911/039684.html >> >> This is the sample code that had me enter th

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Tony Allevato via swift-evolution
On Mon, Sep 11, 2017 at 10:05 PM Gwendal Roué wrote: > >> This doesn't align with how Swift views the role of protocols, though. >> One of the criteria that the core team has said they look for in a protocol >> is "what generic algorithms would be written using this protocol?" >> AutoSynthesize d

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Xiaodi Wu via swift-evolution
On Mon, Sep 11, 2017 at 06:03 Haravikk via swift-evolution < swift-evolution@swift.org> wrote: > On 9 Sep 2017, at 18:41, Xiaodi Wu wrote: > > > On Sat, Sep 9, 2017 at 06:41 Haravikk via swift-evolution < > swift-evolution@swift.org> wrote: > >> On 9 Sep 2017, at 09:33, Xiaodi Wu wrote: >> >> >>

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Vladimir.S via swift-evolution
On 12.09.2017 0:35, Tony Allevato wrote: On Mon, Sep 11, 2017 at 2:05 PM Vladimir.S via swift-evolution mailto:swift-evolution@swift.org>> wrote: On 11.09.2017 21:55, Thorsten Seitz via swift-evolution wrote: > I think I do understand Haravikk's argument (actually it seems quite

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-12 Thread Xiaodi Wu via swift-evolution
On Tue, Sep 12, 2017 at 00:06 Gwendal Roué via swift-evolution < swift-evolution@swift.org> wrote: > >> This doesn't align with how Swift views the role of protocols, though. >> One of the criteria that the core team has said they look for in a protocol >> is "what generic algorithms would be writ

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-11 Thread Gwendal Roué via swift-evolution
> >> This doesn't align with how Swift views the role of protocols, though. One >> of the criteria that the core team has said they look for in a protocol is >> "what generic algorithms would be written using this protocol?" >> AutoSynthesize doesn't satisfy that—there are no generic algorithms

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-11 Thread Tony Allevato via swift-evolution
On Mon, Sep 11, 2017 at 2:43 PM Gwendal Roué via swift-evolution < swift-evolution@swift.org> wrote: > Doesn't it escalate pretty quickly into complex and ad-hoc language > constructs? > > Like everybody I like code synthesis. Like some, I'm worried that implicit > synthesis would hide a few bugs

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-11 Thread Gwendal Roué via swift-evolution
> Le 11 sept. 2017 à 23:37, Tony Allevato via swift-evolution > a écrit : > > All this is a subtle, but important, distinction. One day, when Swift has the > ability to introspect metadata about a type and its properties, someone may > want to use a hypothetical "transient" attribute for some

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-11 Thread Gwendal Roué via swift-evolution
> Le 11 sept. 2017 à 23:41, Gwendal Roué a écrit : > > Doesn't it escalate pretty quickly into complex and ad-hoc language > constructs? > > Like everybody I like code synthesis. Like some, I'm worried that implicit > synthesis would hide a few bugs that are hard to debunk. I also agree that

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-11 Thread Gwendal Roué via swift-evolution
Doesn't it escalate pretty quickly into complex and ad-hoc language constructs? Like everybody I like code synthesis. Like some, I'm worried that implicit synthesis would hide a few bugs that are hard to debunk. I also agree that developers who complain about those bugs would rightfully get the

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-11 Thread Tony Allevato via swift-evolution
On Mon, Sep 11, 2017 at 2:05 PM Vladimir.S via swift-evolution < swift-evolution@swift.org> wrote: > On 11.09.2017 21:55, Thorsten Seitz via swift-evolution wrote: > > I think I do understand Haravikk's argument (actually it seems quite > straightforward > > to me). > > > > An example should be: >

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-11 Thread Vladimir.S via swift-evolution
On 11.09.2017 21:55, Thorsten Seitz via swift-evolution wrote: I think I do understand Haravikk's argument (actually it seems quite straightforward to me). An example should be: struct Foo : Equatable { var x: Int var cachedLabel: String? = nil init(x: Int) { self.x =

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-11 Thread Tony Allevato via swift-evolution
On Mon, Sep 11, 2017 at 11:56 AM Thorsten Seitz via swift-evolution < swift-evolution@swift.org> wrote: > I think I do understand Haravikk's argument (actually it seems quite > straightforward to me). > > An example should be: > > struct Foo : Equatable { > var x: Int > var cachedLabel: St

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-11 Thread Jon Shier via swift-evolution
Mainly because we want synthesis without having to debate keyword naming and killing the proposal, which is what happened every other time before the latest proposal that was actually implemented. I’ll take the tiny danger for the feature in the 99% of other cases which I want it. Jo

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-11 Thread Thorsten Seitz via swift-evolution
I think I do understand Haravikk's argument (actually it seems quite straightforward to me). An example should be: struct Foo : Equatable { var x: Int var cachedLabel: String? = nil init(x: Int) { self.x = x } mutating func label() { if let label = cachedLab

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-11 Thread Jonathan Hull via swift-evolution
What if we tried a completely different type of solution (which might solve the issue for protocol default conformances too)? Right now there are errors and warnings. What if we add a third type of compiler feedback (let’s call it a note). A note is a little bit like a warning, but it can be

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-11 Thread Haravikk via swift-evolution
> On 9 Sep 2017, at 18:41, Xiaodi Wu wrote: > > > On Sat, Sep 9, 2017 at 06:41 Haravikk via swift-evolution > mailto:swift-evolution@swift.org>> wrote: >> On 9 Sep 2017, at 09:33, Xiaodi Wu > > wrote: >> >> >> On Sat, Sep 9, 2017 at 02:47 Haravikk via swift-evolut

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-09 Thread Gwendal Roué via swift-evolution
All right, I'll be more positive: our science, IT, is a *constructive* science, by *essence*. If there is a problem, there must be a way to show it. It you can't, then there is no problem. Gwendal > Le 9 sept. 2017 à 15:26, Gwendal Roué a écrit : > > Hello Haravikk, > > I'lm worried that you

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-09 Thread Xiaodi Wu via swift-evolution
On Sat, Sep 9, 2017 at 06:41 Haravikk via swift-evolution < swift-evolution@swift.org> wrote: > On 9 Sep 2017, at 09:33, Xiaodi Wu wrote: > > > On Sat, Sep 9, 2017 at 02:47 Haravikk via swift-evolution < > swift-evolution@swift.org> wrote: > >> >> On 9 Sep 2017, at 02:02, Xiaodi Wu wrote: >> >>

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-09 Thread Xiaodi Wu via swift-evolution
On Sat, Sep 9, 2017 at 07:51 Brent Royal-Gordon wrote: > On Sep 8, 2017, at 6:03 PM, Xiaodi Wu via swift-evolution < > swift-evolution@swift.org> wrote: > > For any open protocol (i.e., a protocol for which the universe of possible > conforming types cannot be enumerated a priori by the protocol

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-09 Thread Gwendal Roué via swift-evolution
Hello Haravikk, I'lm worried that you fail at preventing a real problem. May I suggest a change in your strategy? Sometimes, sample code greatly helps turning subtle ideas into blatant evidence. After all, subtleties are all about corner cases, and corner cases are the blind spots of imaginati

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-09 Thread Brent Royal-Gordon via swift-evolution
> On Sep 8, 2017, at 6:03 PM, Xiaodi Wu via swift-evolution > wrote: > > For any open protocol (i.e., a protocol for which the universe of possible > conforming types cannot be enumerated a priori by the protocol designer) > worthy of being a protocol by the Swift standard ("what useful thing

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-09 Thread Haravikk via swift-evolution
> On 9 Sep 2017, at 09:33, Xiaodi Wu wrote: > > > On Sat, Sep 9, 2017 at 02:47 Haravikk via swift-evolution > mailto:swift-evolution@swift.org>> wrote: > >> On 9 Sep 2017, at 02:02, Xiaodi Wu > > wrote: >> >> On Fri, Sep 8, 2017 at 4:00 PM, Itai Ferber via swift-e

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-09 Thread Xiaodi Wu via swift-evolution
On Sat, Sep 9, 2017 at 02:47 Haravikk via swift-evolution < swift-evolution@swift.org> wrote: > > On 9 Sep 2017, at 02:02, Xiaodi Wu wrote: > > On Fri, Sep 8, 2017 at 4:00 PM, Itai Ferber via swift-evolution < > swift-evolution@swift.org> wrote: > >> >> >> On Sep 8, 2017, at 12:46 AM, Haravikk vi

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-09 Thread Haravikk via swift-evolution
> On 9 Sep 2017, at 02:02, Xiaodi Wu wrote: > > On Fri, Sep 8, 2017 at 4:00 PM, Itai Ferber via swift-evolution > mailto:swift-evolution@swift.org>> wrote: > > >> On Sep 8, 2017, at 12:46 AM, Haravikk via swift-evolution >> mailto:swift-evolution@swift.org>> wrote: >> >> >>> On 7 Sep 2017,

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-08 Thread Xiaodi Wu via swift-evolution
On Fri, Sep 8, 2017 at 4:00 PM, Itai Ferber via swift-evolution < swift-evolution@swift.org> wrote: > > > On Sep 8, 2017, at 12:46 AM, Haravikk via swift-evolution < > swift-evolution@swift.org> wrote: > > > On 7 Sep 2017, at 22:02, Itai Ferber wrote: > > protocol Fooable : Equatable { // Equatab

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-08 Thread Itai Ferber via swift-evolution
> On Sep 8, 2017, at 12:46 AM, Haravikk via swift-evolution > wrote: > > >> On 7 Sep 2017, at 22:02, Itai Ferber > > wrote: >> >> protocol Fooable : Equatable { // Equatable is just a simple example >> var myFoo: Int { get } >> } >> >> extension Fooable { >>

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-08 Thread Haravikk via swift-evolution
> On 7 Sep 2017, at 22:02, Itai Ferber wrote: > > protocol Fooable : Equatable { // Equatable is just a simple example > var myFoo: Int { get } > } > > extension Fooable { > static func ==(_ lhs: Self, _ rhs: Self) -> Bool { > return lhs.myFoo == rhs.myFoo > } > } > > struc

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-07 Thread Itai Ferber via swift-evolution
> On Sep 7, 2017, at 1:43 PM, Haravikk via swift-evolution > wrote: > >> >> On 7 Sep 2017, at 19:36, Tony Allevato > > wrote: >> >> >> >> On Thu, Sep 7, 2017 at 11:18 AM Haravikk via swift-evolution >> mailto:swift-evolution@swift.org>> wrote: >> >>> On 7

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-07 Thread Haravikk via swift-evolution
> On 7 Sep 2017, at 19:36, Tony Allevato wrote: > > > > On Thu, Sep 7, 2017 at 11:18 AM Haravikk via swift-evolution > mailto:swift-evolution@swift.org>> wrote: > >> On 7 Sep 2017, at 18:53, Tony Allevato via swift-evolution >> mailto:swift-evolution@swift.org>> wrote: >> >> >> >> On Thu

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-07 Thread Xiaodi Wu via swift-evolution
This is a particularly interesting use case that demonstrates a weakness without a good workaround. I, for one, am glad you brought it up, and agree with comments above that auto-generated mandatory enum conformance is a topic perhaps worth revisiting, given this compelling example. On Thu, Sep 7,

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-07 Thread Gwendal Roué via swift-evolution
> Le 7 sept. 2017 à 19:53, Tony Allevato a écrit : > > Again, this is not the issue that Haravikk is describing in this thread. Yes, I better understand now. Please forgive the pollution. Gwendal ___ swift-evolution mailing list swift-evolution@swif

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-07 Thread Tony Allevato via swift-evolution
On Thu, Sep 7, 2017 at 11:18 AM Haravikk via swift-evolution < swift-evolution@swift.org> wrote: > > On 7 Sep 2017, at 18:53, Tony Allevato via swift-evolution < > swift-evolution@swift.org> wrote: > > > > On Thu, Sep 7, 2017 at 10:39 AM Gwendal Roué > wrote: > >> Le 7 sept. 2017 à 14:45, Tony Al

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-07 Thread Haravikk via swift-evolution
> On 7 Sep 2017, at 18:53, Tony Allevato via swift-evolution > wrote: > > > > On Thu, Sep 7, 2017 at 10:39 AM Gwendal Roué > wrote: >> Le 7 sept. 2017 à 14:45, Tony Allevato > > a écrit : >> >> Right, let's make sure we're talki

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-07 Thread Tony Allevato via swift-evolution
On Thu, Sep 7, 2017 at 10:39 AM Gwendal Roué wrote: > Le 7 sept. 2017 à 14:45, Tony Allevato a écrit : > > Right, let's make sure we're talking about the right thing here. Gwendal, > your issue isn't with synthesis in the form of Codable or the new additions > to Equatable/Hashable which are opt

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-07 Thread Itai Ferber via swift-evolution
I think there is a bit of confusion here as to what code synthesis does — synthesized conformances (whether `Equatable`, `Hashable`, or `Codable`) merely provide default implementations for something which _already_ conforms to one of these protocols; they do not _add_ conformance to types on y

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-07 Thread Gwendal Roué via swift-evolution
> Le 7 sept. 2017 à 14:45, Tony Allevato a écrit : > > Right, let's make sure we're talking about the right thing here. Gwendal, > your issue isn't with synthesis in the form of Codable or the new additions > to Equatable/Hashable which are opt-in-by-conformance, it's with the specific > case

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-07 Thread Gwendal Roué via swift-evolution
> Le 7 sept. 2017 à 14:37, Matthew Johnson a écrit : > > I don't understand what this has to do with synthesized Equatable. Wouldn't > manually implemented Equatable have the same impact? The design of a DSL > should be able to accommodate conformance to basic protocols without > ambiguity.

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-07 Thread Matthew Johnson via swift-evolution
Sent from my iPad > On Sep 7, 2017, at 7:45 AM, Tony Allevato wrote: > > Right, let's make sure we're talking about the right thing here. Gwendal, > your issue isn't with synthesis in the form of Codable or the new additions > to Equatable/Hashable which are opt-in-by-conformance, it's with

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-07 Thread Tony Allevato via swift-evolution
Right, let's make sure we're talking about the right thing here. Gwendal, your issue isn't with synthesis in the form of Codable or the new additions to Equatable/Hashable which are opt-in-by-conformance, it's with the specific case of raw value enums or enums without associated values where the sy

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-07 Thread Matthew Johnson via swift-evolution
Sent from my iPad > On Sep 7, 2017, at 7:07 AM, Gwendal Roué via swift-evolution > wrote: > > Hello, > > I'm interested in this debate because I've been bitten by automatic synthesis > recently. > > I'm reading your discussion, but I don't have a strong opinion. I only have > an anecdote:

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-07 Thread Gwendal Roué via swift-evolution
Hello, I'm interested in this debate because I've been bitten by automatic synthesis recently. I'm reading your discussion, but I don't have a strong opinion. I only have an anecdote: implicit, automatic, and unavoidable code synthesis code can make it difficult to write some DSLs (aka Domain-

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-07 Thread Haravikk via swift-evolution
> On 7 Sep 2017, at 00:11, Brent Royal-Gordon wrote: > >> On Sep 5, 2017, at 1:02 PM, Haravikk via swift-evolution >> mailto:swift-evolution@swift.org>> wrote: >> >> This proposal idea is essentially for a new attribute @synthetic (name is up >> for debate). This attribute is required for any

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-06 Thread Andrew Thompson via swift-evolution
>> On Sep 6, 2017, at 1:32 AM, Haravikk via swift-evolution >> wrote: >> >> As a general rule I would argue that Mirrors should almost never be used for >> any purpose, except perhaps debugging; in production code they can lead to >> subtle and misleading problems, not to mention any performanc

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-06 Thread Brent Royal-Gordon via swift-evolution
> On Sep 5, 2017, at 1:02 PM, Haravikk via swift-evolution > wrote: > > This proposal idea is essentially for a new attribute @synthetic (name is up > for debate). This attribute is required for any default implementation that > includes reflective type compiler magic, use of the reflection AP

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-06 Thread Nevin Brackett-Rozinsky via swift-evolution
On Wed, Sep 6, 2017 at 5:42 PM, Haravikk via swift-evolution < swift-evolution@swift.org> wrote: > the issue I'm trying to raise is that when those, and similar features, > are used in synthesised behaviour (default implementations based upon the > concrete type), that these behaviours should be o

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-06 Thread Haravikk via swift-evolution
> On 6 Sep 2017, at 16:26, Eagle Offshore wrote: >> On Sep 6, 2017, at 1:32 AM, Haravikk via swift-evolution >> wrote: >> As a general rule I would argue that Mirrors should almost never be used for >> any purpose, except perhaps debugging; in production code they can lead to >> subtle and mi

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-06 Thread Eagle Offshore via swift-evolution
> On Sep 6, 2017, at 1:32 AM, Haravikk via swift-evolution > wrote: > > As a general rule I would argue that Mirrors should almost never be used for > any purpose, except perhaps debugging; in production code they can lead to > subtle and misleading problems, not to mention any performance i

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-06 Thread Haravikk via swift-evolution
> On 6 Sep 2017, at 01:36, Robert Bennett wrote: > > I take issue with the fact that this problem is no different from > accidentally gaining the default inheritance of *any* member required by a > protocol and implemented in an extension of that protocol. The fact that in > this case conform

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-06 Thread Haravikk via swift-evolution
> On 6 Sep 2017, at 01:36, Robert Bennett > wrote: > > I take issue with the fact that this problem is no different from > accidentally gaining the default inheritance of *any* member required by a > protocol and implemented in an extension of that protocol. The f

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-06 Thread Ben Rimmington via swift-evolution
> On 5 Sep 2017, at 21:02, Haravikk wrote: > > Anyway, this is basically just a rough dump of the ideas for how the > synthesised Codable, Equatable and Hashable behaviours (and anything else > anyone can think of) should be changed before Swift 4 is released. Swift 4, Xcode 9 and iOS 11 will

Re: [swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-05 Thread Robert Bennett via swift-evolution
I take issue with the fact that this problem is no different from accidentally gaining the default inheritance of *any* member required by a protocol and implemented in an extension of that protocol. The fact that in this case conformance is synthesized by the compiler instead of written in sour

[swift-evolution] [Proposal] Explicit Synthetic Behaviour

2017-09-05 Thread Haravikk via swift-evolution
Some of you will have seen my impassioned pleas on the synthesised Equatable/Hashable thread against implementing implicit synthesised behaviour on protocols that must, by necessity, make assumptions about a concrete type that could be incorrect. For those that haven't, the concept of synthetic

  1   2   >