<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="">I understand the desire to wrap this up as it has gone on for a long time.<div class=""><br class=""></div><div class="">I just don’t like the length and readability of the moduleprivate and fileprivate names (and how auto correct is always “fixing” it for me when I try to write about it). As I mentioned these will likely be used very often in code and just don’t look very nice. These are potentially used on almost every method, class, property and struct. I don’t think that we should use something that is perhaps a little clearer in meaning but hard to read for something that is used so frequently through the code. There are plenty of places where you have to look something up the first time you encounter it in any programming language and this explicitness is not a big enough win to sacrifice readability. A single word keyword is a requirement for me.&nbsp;</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">&nbsp;<br class=""><div><blockquote type="cite" class=""><div class="">On Mar 30, 2016, at 6:13 AM, Ilya Belenkiy 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="">I am not sure if we will ever get another access level. If we do, great, but given how long this discussion has been already, I am not counting on it :-)<br class=""><br class="">Most likely, if we get more, it will be possible to describe it with a simple word, or a combination of words or with some common abbreviations, so I am not worried about extensibility. I think that the names in the proposal are very consistent with Swift as it is today and will serve us well. They are also completely unambiguous and don't depend on the reading context, so if we come up with other ways to label access levels, it should still be possible to either use these names for backward compatibility or migrate them automatically to new names without any difference in semantics.<br class=""><br class="">We also needed to pick something. I waited for about a week to get everybody's vote, and I think that I picked a compromise that we can all be at least ok with. (I also originally wanted short single word names). I think we should close the naming thread at this point.<br class=""><div class="gmail_quote"><div dir="ltr" class="">On Wed, Mar 30, 2016 at 5:26 AM Matthew Judge &lt;<a href="mailto:matthew.judge@gmail.com" class="">matthew.judge@gmail.com</a>&gt; wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="">
<br class="">
On Mar 29, 2016, at 20:47, Brent Royal-Gordon via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:<br class="">
<br class="">
&gt;&gt; If Scala style access modifiers were adopted for Swift then a private(file) modifier would also be necessary to give the current private functionality.<br class="">
&gt;<br class="">
&gt; I could imagine having these options:<br class="">
&gt;<br class="">
&gt;&nbsp; &nbsp; public&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // visible to all everyone<br class="">
&gt;&nbsp; &nbsp; private(scope-name, scope-name, …)&nbsp; &nbsp; // visible to specified scopes (plus current scope)<br class="">
&gt;&nbsp; &nbsp; private&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // visible only to current scope<br class="">
&gt;<br class="">
<br class="">
Allowing multiple "scope-name"s is a lot of flexibility and power, but not sure it's useful/worthwhile.<br class="">
<br class="">
&nbsp;For the current discussion, I would think "scope-name" should be limited to an enclosing scope only.&nbsp; So you can say "private(Outer)" from an Inner class or "private(#file)" from within a class, but not "private(ClassA)" from within ClassB.<br class="">
<br class="">
(This would also solve the ambiguity of how to reference the main ClassA or a specific extension to ClassA... "private(ClassA)" can only refer to whichever scope of ClassA you are currently in.)<br class="">
<br class="">
&gt; scope-name could perhaps be:<br class="">
&gt;<br class="">
&gt; * A type name (or Self, which would mimic C++-style private, or perhaps even C++-style protected depending on how we treat inheritance)<br class="">
<br class="">
But, this is getting into type-based access which is beyond the scope of SE-0025 right?<br class="">
<br class="">
&gt; * A module name (or #module for the current module)<br class="">
&gt; * A file name string (or #file for the current file)<br class="">
&gt;<br class="">
&gt; And then the default would simply be `private(#module)`.<br class="">
&gt;<br class="">
&gt; Alternatively, the parameterized level could be given a different name, like `internal` or `shared`. If that were the case, then `#module` might simply be the default.<br class="">
&gt;<br class="">
&gt; --<br class="">
&gt; Brent Royal-Gordon<br class="">
&gt; Architechies<br class="">
&gt;<br class="">
&gt; _______________________________________________<br class="">
&gt; swift-evolution mailing list<br class="">
&gt; <a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class="">
&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
</blockquote></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></body></html>