<div dir="ltr">This would address my concerns.<div><br></div><div>rob</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 24, 2017 at 10:27 AM, Ross O&#39;Brien 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">We should be clear about this, because it seems to me that this is the source of the &#39;cognitive load&#39; problem:<div><br></div><div>Following Alternative 3,</div><div>private properties in scopes, would become &quot;scoped&quot;.</div><div>fileprivate properties in or out of scopes would become &quot;private&quot;.</div><div>private types, such as protocols, classes, etc., would *stay* &quot;private&quot;. The keyword would consistently mean private to the file, instead of changing its meaning at different scopes.</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 24, 2017 at 1:49 PM, Ricardo Parada 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">After reading the discussions it seems to me that renaming private -&gt; scoped and fileprivate -&gt; private might keep both sides happy.<br>
<div class="m_6362685011163851602HOEnZb"><div class="m_6362685011163851602h5"><br>
<br>
<br>
&gt; On Mar 24, 2017, at 9:06 AM, Vladimir.S via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; On <a href="tel:24.03.2017%2011" value="+12403201711" target="_blank">24.03.2017 11</a>:47, Jonathan Hull via swift-evolution wrote:<br>
&gt;&gt; Nevin had a fantastic proposal for submodules which changed private to mean<br>
&gt;&gt; “private to the submodule”, where each file was implicitly a submodule<br>
&gt;&gt; unless you declared otherwise.  Simple and elegant.<br>
&gt;<br>
&gt; Currently I don&#39;t see how submodules can eliminate the needs of &#39;scoped&#39;(current &#39;private&#39;) access level. Even in submodule (even if submodule will be a &quot;namespace&quot; line feature like &quot;submodule Name{..}&quot; and we can have number of such declarations in the same file) - &#39;scoped&#39; access is valuable even for single type declaration. Probably I don&#39;t understand something.<br>
&gt;<br>
&gt; But as for fileprivate - it is really logically to have it named &#39;private&#39; and it can naturally be used in submodules as &quot;private to submodule&quot; just like &quot;private to file&quot; currently.<br>
&gt;<br>
&gt; So I do think the right move currently is to rename fileprivate-&gt;private, private-&gt;scoped and then, when(if!) we have submodules - we can change something.<br>
&gt; Rename will remove the huge confusion users(especially novice) have with &#39;fileprivate&#39; vs &#39;private&#39;; experience shows that *actually* programmers use &#39;fileprivate&#39; a lot and this is some kind of Swift/iOs programming style, and fileprivate is awkward keyword, and many(all? ;-)  just want &#39;private&#39; means &quot;in this file&quot;.<br>
&gt; Also novice programmer can know just about &#39;public&#39;, &#39;internal&#39; and &#39;private&#39; - these three logically united access modifiers,all are file-scoped, but more experienced programmer has no problems teach what &#39;scoped&#39; means and why one want to use it.<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt; On Mar 23, 2017, at 6:27 PM, Drew Crawford via swift-evolution<br>
&gt;&gt;&gt; &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a> &lt;mailto:<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.<wbr>org</a>&gt;&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Sent from my iPhone<br>
&gt;&gt;&gt; On Mar 23, 2017, at 6:41 PM, David Hart &lt;<a href="mailto:david@hartbit.com" target="_blank">david@hartbit.com</a><br>
&gt;&gt;&gt; &lt;mailto:<a href="mailto:david@hartbit.com" target="_blank">david@hartbit.com</a>&gt;&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I have difficulties imagining a submodule proposal that could allow us<br>
&gt;&gt;&gt;&gt; to eliminate fileprivate. Care to give an example?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; The obvious example would be Rust.  Rust has exactly two visibilities,<br>
&gt;&gt;&gt; and merely one keyword.  By default, members are &quot;private&quot; which is<br>
&gt;&gt;&gt; visible inside the module (so, like Swift&#39;s internal). The &quot;public&quot;<br>
&gt;&gt;&gt; keyword is similar to Swift.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; The reason this works is that unlike in Swift where a module is something<br>
&gt;&gt;&gt; like a library or framework (Rust calls those &quot;crates&quot;), in Rust modules<br>
&gt;&gt;&gt; in are (explicitly) lexically scoped; a &quot;mod myscope {}&quot; module can be<br>
&gt;&gt;&gt; created for the portion of the file for which the member should be<br>
&gt;&gt;&gt; visible and it won&#39;t be visible outside that scope. Likewise,<br>
&gt;&gt;&gt; &quot;fileprivate&quot; can be achieved by enclosing the file in a &quot;mod MyFile {}&quot;.<br>
&gt;&gt;&gt; And like all lexical scopes, they can be recursively nested to arbitrary<br>
&gt;&gt;&gt; depth to achieve any number of visibility behaviors (e.g., declare a<br>
&gt;&gt;&gt; module for the first half of two files) that would require complex new<br>
&gt;&gt;&gt; keywords to achieve in Swift. Finally there are some shortcut features<br>
&gt;&gt;&gt; like the ability to infer a module structure from the file system.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; In Swift, modules are presently tied to libraries/frameworks in a 1:1<br>
&gt;&gt;&gt; way. Because of this we lack the flexibility of recursively nestable<br>
&gt;&gt;&gt; modules of other languages and this is the underlying problem that<br>
&gt;&gt;&gt; motivates both scoped/private and fileprivate.  If we fixed that, we<br>
&gt;&gt;&gt; would actually not need either keyword.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; <a href="http://rustbyexample.com/mod/visibility.html" rel="noreferrer" target="_blank">http://rustbyexample.com/mod/v<wbr>isibility.html</a><br>
&gt;&gt;&gt; <a href="https://doc.rust-lang.org/book/crates-and-modules.html" rel="noreferrer" target="_blank">https://doc.rust-lang.org/book<wbr>/crates-and-modules.html</a><br>
&gt;&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt;&gt; swift-evolution mailing list<br>
&gt;&gt;&gt; <a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a> &lt;mailto:<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.<wbr>org</a>&gt;<br>
&gt;&gt;&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-evolution</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt; swift-evolution mailing list<br>
&gt;&gt; <a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
&gt;&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-evolution</a><br>
&gt;&gt;<br>
&gt; ______________________________<wbr>_________________<br>
&gt; swift-evolution mailing list<br>
&gt; <a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-evolution</a><br>
______________________________<wbr>_________________<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/mailma<wbr>n/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div><span style="font-family:arial,helvetica,sans-serif;font-size:20px"><span style="color:rgb(64,64,65)"><strong><span style="font-size:14px">Robert </span></strong></span><span style="font-size:14px"><span style="color:rgb(64,64,65)"><strong>Hedin  </strong></span><span style="color:rgb(105,105,105)"><span style="font-size:16px">|</span></span></span></span><span style="font-family:arial,helvetica,sans-serif;font-size:14px"><span style="color:rgb(64,64,65);margin-left:5px">Dir Software Engineering</span></span></div><span style="font-family:arial,helvetica,sans-serif"><div style="color:rgb(64,64,65);font-weight:bold;font-size:14px"><span style="color:rgb(105,105,105);font-weight:normal;font-size:12px"><strong>w:</strong> 770-226-2650</span><span style="color:rgb(105,105,105);font-weight:normal;font-size:12px">      <strong>e:</strong> <a href="mailto:robert.hedin@weather.com" target="_blank">robert.hedin@weather.com</a></span></div></span><div><div> <a href="http://weather.com/apps" target="_blank"></a><a href="http://weather.com/apps" target="_blank"></a><a href="http://weather.com/apps" target="_blank"></a><a href="http://weather.com/apps" target="_blank"></a><a href="http://weather.com/apps" target="_blank"></a><a href="http://weather.com/apps" target="_blank"></a><a href="http://weather.com/apps" target="_blank"></a><a href="http://weather.com/apps" target="_blank"></a><a href="http://weather.com/apps" target="_blank"></a><a href="http://weather.com/apps" target="_blank"></a><a href="http://weather.com/apps" target="_blank"></a><a href="http://weather.com/apps" target="_blank"></a><a href="http://weather.com/apps" target="_blank"></a><a href="http://weather.com/apps" target="_blank"></a><a href="http://weather.com/apps" target="_blank"></a><a href="http://weather.com/apps" target="_blank"><a href="http://weather.com/apps" target="_blank"><img alt="" src="http://www.theweathercompany.com/sites/default/files/twco_emailsig_225x92_buffered_final.png" style="height:92px;width:225px"></a></a><br>
</div></div></div>
</div>