Re: [swift-evolution] [pitch] Implementation composition

2016-11-25 Thread Matthew Johnson via swift-evolution
> On Nov 25, 2016, at 12:06 PM, Nevin Brackett-Rozinsky via swift-evolution > wrote: > > Protocol forwarding was discussed on-list near the end of 2015 in the thread > “[swift-evolution] [Proposal Draft] automatic protocol forwarding”. Feedback > was generally positive, though there were disa

Re: [swift-evolution] [pitch] Implementation composition

2016-11-25 Thread Nevin Brackett-Rozinsky via swift-evolution
Protocol forwarding was discussed on-list near the end of 2015 in the thread “[swift-evolution] [Proposal Draft] automatic protocol forwarding”. Feedback was generally positive, though there were disagreements about whether the forwarder and/or forwardee should have to conform to the protocol. Also

Re: [swift-evolution] [pitch] Implementation composition

2016-11-25 Thread Tino Heth via swift-evolution
> In what way is this “hiding” protocol conformance? In the examples, MyClass > is declaring conformance to A and B via the Useful protocol composition. > Perhaps I should have made it clearer which bits are new/proposed: Only the > implements word is new here, the protocol composition syntax (

Re: [swift-evolution] [pitch] Implementation composition

2016-11-25 Thread Jay Abbott via swift-evolution
Tino, In what way is this “hiding” protocol conformance? In the examples, MyClass is declaring conformance to A and B via the Useful protocol composition. Perhaps I should have made it clearer which bits are new/proposed: Only the implements word is new here, the protocol composition syntax (A & B

Re: [swift-evolution] [pitch] Implementation composition

2016-11-25 Thread Tino Heth via swift-evolution
Kotlin has a imho really nice solution for this: Because constructor parameters appear right after the class declaration, you can refer to them in the inheritance-clause. Protocol conformance is a quite important aspect of a type, so I'm not sure if it wise to allow "hiding" it — and I hope the

Re: [swift-evolution] [pitch] Implementation composition

2016-11-25 Thread Rien via swift-evolution
I like that. Have you considered the following? protocol foobar { func foo() … func bar() ... } class A: foobar { …} class B: foobar { let a = A() implements foobar.foo let b = A() implements foobar.bar } Regards, Rien Site: http://balancingrock.nl Blog: http:/

[swift-evolution] [pitch] Implementation composition

2016-11-25 Thread Jay Abbott via swift-evolution
We already have a great way to compose APIs using protocol composition, and we can supply default implementations for protocol methods, but what if we want to compose implementations from existing types? Say I have two disparate protocols: protocol A { func methodA1() func methodA2() }pro