<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>I think that the current approach marks a regression in declarative expressiveness as the notion of extending a class over implementing a protocol is blurred while the concepts are IMHO not the same (the latter is about behaviour conformance not a is a relationship):<br><br>Class/struct B : Class/struct A <Protocol1 & Protocol2> </div><div id="AppleMailSignature"><div style="direction: inherit;"><br></div><div style="direction: inherit;"><br></div><div style="direction: inherit;">would be a clear and concise way to express it that would not be confused even at a quick glance.</div><br>Sent from my iPhone</div><div><br>On 22 Jul 2016, at 14:47, Charlie Monroe via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div><span>I agree that this is an issue. Mostly nowadays when more and more classes in Swift do not have a superclass - it simply looks weird:</span><br><span></span><br><span>class MyClass: DataSource</span><br><span></span><br><span>One doesn't know whether "DataSource" is a class, protocol, etc. Nevertheless, I do not feel that :: is the answer. I really liked, how ObjC did it (which isn't possible with the generics now - is it?), but what about something like this?</span><br><span></span><br><span>class BaseClass [SomeDelegate, OtherDelegate, ProtocolX]</span><br><span>class MyClass: BaseClass [SomeDelegate, OtherDelegate, ProtocolX]</span><br><span>extension MyClass [OtherProtocol]</span><br><span></span><br><span></span><br><blockquote type="cite"><span>On Jul 22, 2016, at 3:14 PM, Vladimir.S via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>I remember that this was discussed, but can't find any decision regarding this.. So, as a last chance, don't we want in Swift 3.0, as big source breaking change, separate class inheritance and protocol conformance in syntax?</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Sorry if there was a decision about this suggestions. Please let know in this case.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>I.e. when I see the following I can't understand if the class inherits from base class and conforms to protocols or just conforms to two protocols:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>class MyClass : First, Second, Third {</span><br></blockquote><blockquote type="cite"><span>}</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>We don't have a rule to name protocols with 'Protocol'/other suffix/prefix, or classes with 'T'/'C' prefix or something like this, so I believe to improve the clarity of code we should separate in syntax inheritance and conformance.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>As I understand we should discuss changes in these areas:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>1. class inheritance :</span><br></blockquote><blockquote type="cite"><span>class Child: BaseClass</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>2. class conformance :</span><br></blockquote><blockquote type="cite"><span>class Child: SomeProtocol1, SomeProtocol2</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>3. class inheritance + conformance :</span><br></blockquote><blockquote type="cite"><span>class Child: BaseClass, SomeProtocol1, SomeProtocol2</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>4. protocol conformance for structs:</span><br></blockquote><blockquote type="cite"><span>struct Struct: SomeProtocol1, SomeProtocol2</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>5. protocol inheritance:</span><br></blockquote><blockquote type="cite"><span>protocol Child: BaseProtocol1, BaseProtocol2</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>My suggestions:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>I) separate inheritance with double colon :</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>1. class inheritance :</span><br></blockquote><blockquote type="cite"><span>class Child:: BaseClass</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>2. class conformance :</span><br></blockquote><blockquote type="cite"><span>class Child: SomeProtocol1, SomeProtocol2</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>3. class inheritance + conformance :</span><br></blockquote><blockquote type="cite"><span>class Child:: BaseClass : SomeProtocol1, SomeProtocol2</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>4. protocol conformance for structs:</span><br></blockquote><blockquote type="cite"><span>struct Struct: SomeProtocol1, SomeProtocol2</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>5. protocol inheritance:</span><br></blockquote><blockquote type="cite"><span>protocol Child:: BaseProtocol1, BaseProtocol2</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>II) in class definition use parenthesis to separate inheritance and conformance :</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>1. class inheritance :</span><br></blockquote><blockquote type="cite"><span>class Child: BaseClass</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>2. class conformance :</span><br></blockquote><blockquote type="cite"><span>class Child: (SomeProtocol1, SomeProtocol2)</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>3. class inheritance + conformance :</span><br></blockquote><blockquote type="cite"><span>class Child: BaseClass (SomeProtocol1, SomeProtocol2)</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>4. protocol conformance for structs:</span><br></blockquote><blockquote type="cite"><span>struct Struct: SomeProtocol1, SomeProtocol2</span><br></blockquote><blockquote type="cite"><span>or</span><br></blockquote><blockquote type="cite"><span>struct Struct: (SomeProtocol1, SomeProtocol2)</span><br></blockquote><blockquote type="cite"><span>should be discussed</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>5. protocol inheritance:</span><br></blockquote><blockquote type="cite"><span>protocol Child: BaseProtocol1, BaseProtocol2</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>III) special word like 'conforms'</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>1. class inheritance :</span><br></blockquote><blockquote type="cite"><span>class Child: BaseClass</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>2. class conformance :</span><br></blockquote><blockquote type="cite"><span>class Child: conforms SomeProtocol1, SomeProtocol2</span><br></blockquote><blockquote type="cite"><span>or</span><br></blockquote><blockquote type="cite"><span>class Child conforms SomeProtocol1, SomeProtocol2</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>3. class inheritance + conformance :</span><br></blockquote><blockquote type="cite"><span>class Child: BaseClass conforms SomeProtocol1, SomeProtocol2</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>4. protocol conformance for structs:</span><br></blockquote><blockquote type="cite"><span>struct Struct: conforms SomeProtocol1, SomeProtocol2</span><br></blockquote><blockquote type="cite"><span>or</span><br></blockquote><blockquote type="cite"><span>struct Struct conforms SomeProtocol1, SomeProtocol2</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>5. protocol inheritance:</span><br></blockquote><blockquote type="cite"><span>protocol Child: BaseProtocol1, BaseProtocol2</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Thoughts?</span><br></blockquote><blockquote type="cite"><span>_______________________________________________</span><br></blockquote><blockquote type="cite"><span>swift-evolution mailing list</span><br></blockquote><blockquote type="cite"><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br></blockquote><blockquote type="cite"><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></blockquote><span></span><br><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>