<div dir="ltr"><span style="font-size:13px">public</span><br style="font-size:13px"><span style="font-size:13px">internal</span><br style="font-size:13px"><span style="font-size:13px">(fileprivate | interfile)</span><br style="font-size:13px"><span style="font-size:13px">private</span><br><div><span style="font-size:13px"><br></span></div><div>Either choice is fine with me</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 31, 2016 at 11:33 AM, Jesse Squires via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I really like this. +1 for the following:<div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px">public</span><br style="font-size:13px"><span style="font-size:13px">internal</span><br style="font-size:13px"><span style="font-size:13px">fileprivate</span><br style="font-size:13px"><span style="font-size:13px">private</span></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px">-Jesse</span></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Wed, Mar 30, 2016 at 9:22 PM, Chris Lattner via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mar 23, 2016, at 10:13 PM, Chris Lattner &lt;<a href="mailto:clattner@apple.com" target="_blank">clattner@apple.com</a>&gt; wrote:<br>
&gt; How about we continue this trend, and follow other existing Swift keywords that merge two lowercase words (associatedtype, typealias, etc), and use:<br>
&gt;<br>
&gt;       public<br>
&gt;       moduleprivate<br>
&gt;       fileprivate<br>
&gt;       private<br>
&gt;<br>
&gt; The advantages, as I see them are:<br>
&gt; 1) We keep public and private meaning the “right” and “obvious” things.<br>
&gt; 2) The declmodifiers “read” correctly.<br>
&gt; 3) The unusual ones (moduleprivate and fileprivate) don’t use the awkward parenthesized keyword approach.<br>
&gt; 4) The unusual ones would be “googable”.<br>
&gt; 5) Support for named submodules could be “dropped in” by putting the submodule name/path in parens: private(foo.bar.baz) or moduleprivate(foo.bar).  Putting an identifier in the parens is much more natural than putting keywords in parens.<br>
<br>
I’ve seen a number of concerns on this list about moduleprivate, and how it penalizes folks who want to explicitly write their access control.  I’ve come to think that there is yes-another possible path forward here (which I haven’t seen mentioned so far):<br>
<br>
public<br>
internal<br>
fileprivate<br>
private<br>
<br>
The advantages, as I see them are:<br>
1) We keep public and private meaning the “right” and “obvious” things.<br>
2) The declmodifiers “read” correctly.<br>
3) Compared to Swift 2, there is almost no change.  The only thing that changes is that some uses of Swift 2 “private” will be migrated to “fileprivate”, which makes the intent of the code much more clear.<br>
4) fileprivate is the unusual and not-really-precedented-in-other-languages modifier, and it would still be “googable”.<br>
5) The addresses the “excessively long” declmodifier problem that several people are concerned with.<br>
6) Support for named submodules could be “dropped in” by parameterizing “internal”.<br>
<br>
Thoughts?<br>
<br>
-Chris<br>
<div><div>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div><div dir="ltr"><div>Jesse Squires</div><div><br></div><div><div style="color:rgb(0,0,0);line-height:19px;font-family:helvetica,arial"><b>blog</b> | <a href="http://www.jessesquires.com" target="_blank">jessesquires.com</a></div><div style="color:rgb(0,0,0);line-height:19px;font-family:helvetica,arial"><b>github</b> | <a href="http://www.github.com/jessesquires" target="_blank">github.com/jessesquires</a></div><div style="color:rgb(0,0,0);line-height:19px;font-family:helvetica,arial"><b>hexedbits</b> | <a href="http://www.hexedbits.com" target="_blank">hexedbits.com</a></div></div></div></div>
</font></span></div>
<br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div>