<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On 13 Jun 2016, at 15:52, Erica Sadun <<a href="mailto:erica@ericasadun.com" class="">erica@ericasadun.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I'm not sure what enhancing defaults would look like, especially for protocols. Are you suggesting if there's a protocol like:</div><div class=""><br class=""></div><div class="">protocol A {</div><div class=""> func requiredFunction(a, b, c) -> T</div><div class="">}</div><div class=""><br class=""></div><div class="">that you could then extend </div><div class=""><br class=""></div><div class="">extension A {</div><div class=""> func requiredFunction(a, b = somedefault, c) -> T;</div><div class="">}</div><div class=""><br class=""></div><div class="">as a declaration without an implementation?</div></div></div></blockquote><div><br class=""></div><div>I was thinking more that we could allow a fixed default on protocols where it makes sense to, for example:</div><div><br class=""></div><div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>protocol A {</font></div><div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">                </span>func requiredFunction(a, b = somedefault, c) -> T</font></div><div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</font></div><div><br class=""></div><div>In this case all conforming types need to specify the same default for absolute consistency, but this may be a bit divergent from what the OP actually wants, I just mentioned it because it seemed a bit similar. This would come with the caveat that most of the time you don’t want to do this (as it could unnecessarily limit implementations) but it would mean that you know what the default is for every single conforming type.</div><div><br class=""></div><div><br class=""></div><div>Specifically for the OP though an attribute might make more sense, like:</div><div><br class=""></div><div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>struct Foo : A {</font></div><div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">                </span>func requiredFunction(a, b = @public somedefault, c) -> T { … }</font></div><div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</font></div><div><br class=""></div><div>Here the default for b is explicitly declared as public, so would be exposed via documentation automatically; this would require that it isn’t derived from anything hidden (allowing this to be checked) and wouldn’t involve exposing every default value implicitly just for being on a public method as the OP was questioning.</div><div><br class=""></div><div><br class=""></div><div>Just some options anyway, since I don’t think exposing all defaults automatically is really viable.</div></div></body></html>