<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><div><br>On Apr 28, 2016, at 8:09 PM, Erica Sadun via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="font-family: Palatino-Roman;" class="">Sorry, that's not my question, which doesn't involve protocols I don't own. Let me restate. Given three types I don't own as follows:<br class=""></div><div style="font-family: Palatino-Roman;" class=""><br class=""></div><div style="font-family: Palatino-Roman;" class="">```</div><div style="font-family: Palatino-Roman;" class=""><div class="">struct A : Frobnicate {</div><div class="">&nbsp; &nbsp; override required func frobnicate() { print("A") } // "A", or delete to get default</div><div class="">}</div><div class="">struct B: Frobnicate {</div><div class="">&nbsp; &nbsp;&nbsp;override required&nbsp;func frobnicate() { print("B") } // "B", or delete to get default</div><div class="">}</div><div class="">struct C: Frobnicate &nbsp;{ }</div></div><div style="font-family: Palatino-Roman;" class="">```</div></div></blockquote><div><br></div><div>These are a couple of derived situations:&nbsp;<br><blockquote type="cite"><div class=""><div class=""><font color="#000000"><span style="background-color: rgba(255, 255, 255, 0);">struct IAssumeThisIsAProblem : Frobnicate {</span></font></div><div class=""><font color="#000000"><span style="background-color: rgba(255, 255, 255, 0);">&nbsp; &nbsp; required func frobnicate() { print("A") }&nbsp;</span></font></div><div class=""><font color="#000000"><span style="background-color: rgba(255, 255, 255, 0);">}</span></font></div></div></blockquote></div><div><br><blockquote type="cite"><div class=""><div class=""><font color="#000000"><span style="background-color: rgba(255, 255, 255, 0);">struct&nbsp;IAssumeThisIsAnotherProblem</span></font><span style="background-color: rgba(255, 255, 255, 0);">&nbsp; Frobnicate {</span></div></div></blockquote><blockquote type="cite"><div class=""><div class=""><font color="#000000"><span style="background-color: rgba(255, 255, 255, 0);">&nbsp; &nbsp; override func frobnicate() { print("A") }&nbsp;</span></font></div><div class=""><font color="#000000"><span style="background-color: rgba(255, 255, 255, 0);">}</span></font></div></div></blockquote></div><div><br></div><div>What happens in both cases?</div><br><blockquote type="cite"><div><div style="font-family: Palatino-Roman;" class=""><br class=""></div><div style="font-family: Palatino-Roman;" class=""><div class="">-- E</div><div class=""><br class=""></div><div class=""><br class=""></div></div><div><blockquote type="cite" class=""><div class="">On Apr 28, 2016, at 11:48 AM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: 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="">Sorry, that's not my question, which doesn't involve protocols I don't own. Let me restate. Given three types I don't own as follows:<br class=""></div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: 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=""><br class=""></div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: 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="">```</div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: 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=""><div class="">struct A {</div><div class="">&nbsp; &nbsp; func frobnicate() { print("A") }</div><div class="">}</div><div class="">struct B {</div><div class="">&nbsp; &nbsp; func frobnicate() { print("B") }</div><div class="">}</div><div class="">struct C { }</div></div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: 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="">```</div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: 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=""><br class=""></div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: 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 want to conform them to a protocol of my own design, Frobnicatable, and supply a default `frobnicate()`:</div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: 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=""><br class=""></div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: 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="">```</div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: 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=""><div class="">protocol Frobnicatable {</div><div class="">&nbsp; &nbsp; func frobnicate()</div><div class="">}</div><div class="">extension Frobnicatable {</div><div class="">&nbsp; &nbsp; func frobnicate() { print("Default") }</div><div class="">}</div><div class="">extension A: Frobnicatable { }</div><div class="">extension B: Frobnicatable { }</div><div class="">extension C: Frobnicatable { }</div></div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: 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=""><br class=""></div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: 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="">let c = C()</div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: 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="">c.frobnicate() // "Default"</div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: 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="">```</div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: 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=""><br class=""></div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: 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=""><div class="">(Yes, I realize there are issues regarding static and dynamic dispatch that limit the utility of this particular example--let's leave those aside for now.)</div><div class="">Where would I affix keywords such as `required` and `override` to make this work after implementation of your proposal?</div></div></div></blockquote></div><br class=""></div></blockquote><blockquote type="cite"><div><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>