<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 Jul 6, 2016, at 4:36 PM, Scott James Remnant via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; 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=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jul 6, 2016, at 2:13 PM, Leonardo Pessoa &lt;<a href="mailto:me@lmpessoa.com" class="">me@lmpessoa.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">You can also try and simplify your outlines reducing X.c and X.d to a<br class="">single entry as it is the same rule applied to two different elements<br class="">of the language. Using one single keyword (such as in 'open') would<br class="">make it clearer and that is why I prefer to have only one keyword.<br class=""><br class=""></div></div></blockquote><div class=""><br class=""></div><div class=""><div class="">I didn’t simply the outlines precisely because the proposal suggests two keywords.</div><div class=""><br class=""></div><div class="">One keyword does solve this problem, but not the problem of conflation of finality and access control.</div><div class="">You end up with this matrix:</div><div class=""><br class=""></div><div class=""><font face="SFMono-Regular" class="">&nbsp; access &nbsp; &nbsp; &nbsp;| can override | final</font></div><div class=""><font face="SFMono-Regular" class="">&nbsp;-------------+--------------+-------</font></div><div class=""><font face="SFMono-Regular" class="">&nbsp;&nbsp;open &nbsp; &nbsp; &nbsp; &nbsp;| yes &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| Error - “class cannot be open and final”</font></div></div></div></div></div></blockquote><div><br class=""></div><div>Of course this produces a compile error. &nbsp;Open means “can subclass” which directly contradicts final.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><div class=""><font face="SFMono-Regular" class="">&nbsp; public &nbsp; &nbsp; &nbsp;| no &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Error -&nbsp;“public class is already final by default”</font></div></div></div></div></div></blockquote><div><br class=""></div><div>This is not true. &nbsp;Public classes will *not* be “final by default”. &nbsp;It *will* be possible to subclass them within their declaring module. &nbsp;If they need to be final they will still need to be marked as such. &nbsp;</div><div><br class=""></div><div>With that in mind, the your “can override” column (do you really mean “can subclass” here?) is also not correct. &nbsp;The correct answer is “yes, within the module”. &nbsp;The fundamental difference for this row is that there are some scopes which can *see* the type without the ability to subclass it. &nbsp;There is no problem with this, it is *exactly* what we want. &nbsp;</div><div><br class=""></div><div>The purpose of this proposal is precisely to give library authors the ability to have more fine grained control over what capabilities their library exposes to users.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><div class=""><font face="SFMono-Regular" class="">&nbsp; internal &nbsp; &nbsp;| yes &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| final</font></div><div class=""><font face="SFMono-Regular" class="">&nbsp; fileprivate | yes &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| final</font></div><div class=""><font face="SFMono-Regular" class="">&nbsp; private &nbsp; &nbsp; | yes &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| final</font></div><div class=""><br class=""></div><div class="">This is way more confusing than the current language:</div><div class=""><br class=""></div><div class=""><div class=""><font face="SFMono-Regular" class="">&nbsp; access &nbsp; &nbsp; &nbsp;| can override | final</font></div><div class=""><font face="SFMono-Regular" class="">&nbsp;-------------+--------------+-------</font></div><div class=""><span style="font-family: SFMono-Regular;" class="">&nbsp; public &nbsp; &nbsp; &nbsp;| yes &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| final</span></div><div class=""><font face="SFMono-Regular" class="">&nbsp; internal &nbsp; &nbsp;| yes &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| final</font></div><div class=""><font face="SFMono-Regular" class="">&nbsp; fileprivate | yes &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| final</font></div><div class=""><font face="SFMono-Regular" class="">&nbsp; private &nbsp; &nbsp; | yes &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| final</font></div><div class=""><br class=""></div><div class="">I strongly favor a programming language that doesn’t introduce compiler errors to solve problems that could be solved by cleaner syntax.</div><div class=""><br class=""></div><div class="">Since it’s already necessary to place the `public` keyword in front of every class, method, property, or subscript that you intend to make public, the developer is already thinking about the public API. Typing `public final` instead of `public` is an extra keyword, it’s not an extra cognitive burden since that cognition is already taking place.</div></div></div></div></div></div></blockquote><div><br class=""></div><div>As you can see from the points above, `public final` is something very different than both `public` and `public subclass able` (or `open`) under the current proposal. &nbsp;It is not a question of cleaner syntax. &nbsp;It is a question of whether we want to give library authors more fine grained control.</div><div><br class=""></div><div>-Matthew</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><div class=""><div class=""><br class=""></div><div class="">Scott</div></div></div></div><br class=""></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>