<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Yes, whenever I implement the delegate pattern, I have to make sure the protocol is a class protocol so I can use a weak reference. </div><div class=""><br class=""></div><div class="">While I use protocols for far more than just delegation, for the newer developers coming to Swift from Objective-C, the delegation pattern probably remains the most common use of protocols, so I agree we should make it as simple to use/understand as possible. +1 for the proposed syntax.</div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Dec 7, 2015, at 9:20 AM, Matthew Cheok via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">I would expect this to be somewhat common for building weakly referenced delegates without @objc. Shouldn't this be more common in practice?</div><div class="gmail_extra" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""><div class="gmail_quote">On Mon, Dec 7, 2015 at 8:51 AM, Stephen Celis<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:stephen.celis@gmail.com" target="_blank" class="">stephen.celis@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class="">Do others find themselves implementing class-only protocols often? They seem to be the exception, rather than the rule, to me.<span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">Stephen</div></font></span><div class=""><div class="h5"><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Dec 7, 2015 at 11:32 AM, Sean Heber via swift-evolution<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">I found this odd, too. I don’t know what kind of parsing ramifications this might have, but I like the idea. I suppose one downside is that it makes protocols for classes seem somehow special or different from other protocols - but then again, they kind of are!<br class=""><br class="">l8r<br class="">Sean<br class=""><div class=""><div class=""><br class=""><br class="">> On Dec 7, 2015, at 10:00 AM, Matthew Cheok via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>> wrote:<br class="">><br class="">> Currently, we declare class protocols with the following syntax:<br class="">><br class="">> protocol TestProtocol: class, OtherProtocol {}<br class="">><br class="">> This is odd for a few reasons:<br class="">> 1) The keyword class exists in the middle of the declaration<br class="">> 2) The keyword class follows the colon and looks a lot like inheritance<br class="">> 3) The keyword class occupies a somewhat arbitrary first position after the colon (otherwise we have an error)<br class="">><br class="">> We also have another use of the class keyword as a modifier when declaring class methods:<br class="">><br class="">> class func doSomething() {}<br class="">><br class="">> I’m suggesting a change of syntax that rectifies the above issues:<br class="">><br class="">> class protocol TestProtocol: OtherProtocol {}<br class="">><br class="">> Would love to hear other thoughts on this.<br class="">><br class="">> - Matthew<br class="">><br class="">> _______________________________________________<br class="">> swift-evolution mailing list<br class="">><span class="Apple-converted-space"> </span><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class="">><span class="Apple-converted-space"> </span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=R83Kt0gRLonfxLfvm7HjfBLbNxx0bjwcHwRgJKRSCf1K0S43ZYotnRpaaeJGZo8Y7bfH-2F1LK4bcSiIpKRu8vPxkZD2NIb-2BoYmTC1lEzwcqbW3J9UkkIlTZ9uou4N1z3eb8NAjfUJ6mA-2FqhMgcnIfdB45jLLJZnkJ68pnzb3waOXdfePv14HxXUwkaSGINoKqCkmWSZWXm9m0FneKtQT2yScJ7DKwwD6B5NoYoF5gp3Y-3D" alt="" width="1" height="1" border="0" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><span class="Apple-converted-space"> </span>_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-evolution@swift.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-evolution@swift.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class=""></body></html>