<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 7 Oct 2016, at 07:39, David Hart 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="">Hello community,<div class=""><br class=""></div><div class="">From all the proposals which has gone into Swift 3, <b class="">[SE-0025] Scoped Access Level</b> is the only one I’m having second thoughts about. Before launching a discussion around it, I’m curious to know if it's worth discussing it or if the “ship has sailed”. As the plan is to allow future versions of Swift to break source-compatibility in certain rare scenarios, perhaps we have a chance to reconsider certain proposals?</div><div class=""><br class=""></div><div class="">Regards,</div><div class="">David.</div></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=""><div class="">What in particular don't you like about it?</div><div class=""><br class=""></div><div class="">Personally I still don't like the use of fileprivate as the keyword, I was very much in favour of a bracketed system like:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>private(scope)<span class="Apple-tab-span" style="white-space:pre">                </span>Current private (I think, it doesn't appear to be equivalent to protected in other languages anyway so I wouldn't call it type).</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>private(file)<span class="Apple-tab-span" style="white-space:pre">                </span>Current fileprivate</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>private(module)<span class="Apple-tab-span" style="white-space:pre">        </span>Current internal/default when omitted</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>public<span class="Apple-tab-span" style="white-space:pre">                        </span>Current public</div><div class=""><br class=""></div><div class="">I favour this because it groups all restrictive access levels under private (since they're all some form of private) with an optional modifier that's explicit about what it's for. Also, it would have scope to move things like final into a modifier too, so you might declare a method as public(final), or public(open) if that's implemented later and so-on. Just seems like a generally more flexible setup that also reduces the number of keywords required.</div><div class=""><br class=""></div><div class="">Some may feel it's noisy, but personally I don't see it as a problem as it always comes before the func/var/let keyword, generics and function name, so it's not like it's near anything where the (minor) noise reduces readability.</div><div class=""><br class=""></div><div class="">But yeah, having used the new fileprivate for a little while I just don't like it; it may partly come down to the fact that I use fileprivate a lot more than I use regular private. If we were to adopt the above scheme I would recommend that private(file) be the default for use of the plain private keyword, unless we gain the ability to specify private(type) (i.e- protected in most other languages), as private(scope) seems like it's the less common, at least in my experience.</div></body></html>