<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>on Sun, 5 Nov 2017 09:27:09 +0000 Goffredo Marocchi &lt;<a href="mailto:panajev@gmail.com">panajev@gmail.com</a>&gt; wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
I would say that you kind of already entered a slippery slope when the extension to a protocol can add code / not just declare a behavioural contract ...</blockquote><div><br></div><div>to me protocol extensions are both cool and evil. cool as you can add code. evil because it&#39;s more natural to add another declarations in those extensions rather than implementation:</div><div><br></div><div>protocol Foo {</div><div>    func foo()</div><div>}</div><div><br></div><div>extension Foo {</div><div>   func bar()    //*** natural assumption is that i can do this. but i can&#39;t</div><div>}</div><div><br></div><div>i&#39;d say, abusing &quot;extension protocol&quot; syntax to add code looks like a (cool) hack and my +1 would be for some other more explicit syntactic construct for the purposes of adding code, for example:</div><div><br></div><div>implementation Foo {</div><div>    func foo() {</div><div>        ...</div><div>    }</div><div>}</div><div><br></div><div>Mike</div><div><br></div></div></div></div>