Great, thank you!<br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 28, 2016 at 12:05 PM Douglas Gregor &lt;<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div>On Jan 27, 2016, at 4:43 AM, Ilya Belenkiy via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><div><div style="word-wrap:break-word"><div>I am not sure who to ask, so I’ll ask here:</div><div><br></div><div>At what stage do proposals get merged into the “proposals” folder? Is there some order in which proposals get scheduled for review? My proposal was thoroughly discussed twice on this list. Is there anything else that I can do to get it scheduled for a review?</div></div></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><div><div>One of the core team members will get it merged today. Sorry for the delay! There is a *lot* going on in swift-evolution land.</div><div><br></div><span style="white-space:pre-wrap">        </span>- Doug</div></div><div style="word-wrap:break-word"><div><br><blockquote type="cite"><div><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On Jan 26, 2016, at 9:29 AM, Ilya Belenkiy &lt;<a href="mailto:ilya.belenkiy@gmail.com" target="_blank">ilya.belenkiy@gmail.com</a>&gt; wrote:</div><br><div><div style="word-wrap:break-word"><div><blockquote type="cite"><div style="word-wrap:break-word"><div>This is certainly not what I wrote. What I said is that hiding the private interface becomes a practical concern on large scale, when you deal with projects or libraries. Swift already solves that issue with per-file and per-module visibility. And when editing the narrow scope (the file), one should make sure that one knows that they are doing (not unlike what you wrote yourself). </div></div></blockquote></div><div><div style="word-wrap:break-word"><div><br></div><div>Why not automate it if we can?</div><div><br></div><div><blockquote type="cite"><div style="word-wrap:break-word"><div>Oh, I quite agree with you here. But I still don’t think that declaration scope access is really necessary to achieve this (because quite honestly, the future-Taras messages are best conveyed through documentation strings :) ). </div></div></blockquote><br></div><div>Would you remove all type checking and rely solely on the documentation to make function calls? If you wouldn’t, exactly the same reasoning applies to *where* a function can be called.</div><div><br></div><div><blockquote type="cite"><div style="word-wrap:break-word"><div>I do not believe that your example is even remotely appropriate. These problems are on a totally different scale. You can’t seriously mean the the lack of definition scope access poses challenges that are even remotely similar to those associated with the lack of type checking. </div></div></blockquote><br></div><div>I can and I do. Data encapsulation is a cornerstone for object oriented programming for a very good reason.</div><div><br></div><div><blockquote type="cite"><div style="word-wrap:break-word"><div>No compiler sugar will prevent people from using your internal APIs if they want to. </div></div></blockquote><br></div><div>True, but the same applies to type checking. We should have real data encapsulation for exactly the same reason.</div><div><br></div><div><blockquote type="cite"><div style="word-wrap:break-word"><div>At any rate, I can’t help but notice that we are going in circles here. </div></div></blockquote><br></div><div>We are. I hope that my pull request with the proposal will be merged and reviewed soon. This issue has already received plenty of discussion here.</div></div></div><br><div><blockquote type="cite"><div>On Jan 26, 2016, at 8:36 AM, Taras Zakharko &lt;<a href="mailto:taras.zakharko@uzh.ch" target="_blank">taras.zakharko@uzh.ch</a>&gt; wrote:</div><br><div><div style="word-wrap:break-word"><div><blockquote type="cite"><div style="word-wrap:break-word"><div><div><div><div><blockquote type="cite"><div>On Jan 25, 2016, at 11:22 PM, Rob Mayoff via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div></blockquote></div></div></div></div></div></blockquote><blockquote type="cite"><div style="word-wrap:break-word"><div><div><div><div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra">By this logic, you don&#39;t want or need private (Swift&#39;s private-to-file) either. You just want/need internal and public, because you trust your judgement and you want access to everything in the project.</div></div></div></blockquote></div></div></div></div></div></blockquote><br></div><div>This is certainly not what I wrote. What I said is that hiding the private interface becomes a practical concern on large scale, when you deal with projects or libraries. Swift already solves that issue with per-file and per-module visibility. And when editing the narrow scope (the file), one should make sure that one knows that they are doing (not unlike what you wrote yourself). </div><div><br></div><div><blockquote type="cite"><div style="word-wrap:break-word"><div><div><div><div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra">I&#39;m not arguing that Swift needs, say, Scala&#39;s level of detail in its access modifiers, but I think an access modifier for private-to-class or private-to-instance or private-to-scope would let past-Rob convey useful information to future-Rob in a lot of places where currently the information is less precise or entirely absent, and that this ability is useful enough to justify the additional language complexity.</div></div></div></blockquote></div></div></div></div></div></blockquote><br></div><div>Oh, I quite agree with you here. But I still don’t think that declaration scope access is really necessary to achieve this (because quite honestly, the future-Taras messages are best conveyed through documentation strings :) ). See also the summary at the end of my mail. Subclass scope is a different story, because it has many practical uses, but thats a topic for another discussion. </div><div><br></div><div><blockquote type="cite">On 26 Jan 2016, at 14:00, Ilya Belenkiy via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</blockquote><blockquote type="cite"><div style="word-wrap:break-word">The reasoning is the same as having real types instead of conventions for naming objects:</div></blockquote><br></div><div>I do not believe that your example is even remotely appropriate. These problems are on a totally different scale. You can’t seriously mean the the lack of definition scope access poses challenges that are even remotely similar to those associated with the lack of type checking. </div><div><br></div><div><blockquote type="cite"><div style="word-wrap:break-word"><div>There are plenty of discussions about Cocoa private APIs on the web where the only thing that is stopping people is whether using them will pass the app store check (and if there is a secret back door still). That specific boundary is addressed with “internal”, but the same is true at the scale of a class.</div></div></blockquote><br></div><div>No compiler sugar will prevent people from using your internal APIs if they want to. With Objective-C this is particularly easy, due to the dynamic nature of the language. Even if Swift had the definition scope access modifier, one could get access to your private interface by reverse-engineering the memory layout of your object and accessing the state directly. The only real argument in favour of definition scope is bug prevention, and as far as I am concerned, it is a matter of opinion (I do like your point about autocompletion though). Again, as I wrote before, I am ambivalent. I don’t think that Swift will loose anything by introducing definition scope access but I also don’t think that it will gain anything. </div><div><br></div><div>At any rate, I can’t help but notice that we are going in circles here. I think that the decision should be made by the core Swift team, who should evaluate how well it fits with their vision. </div><div><br></div><div>Best, </div><div><br></div><div> Taras</div><br><div><blockquote type="cite"><div>On 26 Jan 2016, at 14:00, Ilya Belenkiy via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><div><div style="word-wrap:break-word">This a great writeup on clarity of intent. I’d like to add that in principle, if clarity of intent was the only goal, it could be achieved by a universally agreed on convention, like putting _ in front of the method or property (or type) . We could put it in guidelines and rely on it in all Swift projects. The other part that it is enforced by the compiler is equally important. The reasoning is the same as having real types instead of conventions for naming objects:<div><br></div><div>Imagine that the Swift compiler did nothing for types — it was just a useful way to convey the coder’s intent. Maintaining the code in this context would become much more difficult:</div><div><br></div><div>1) the compiler would not help catch mistakes.</div><div>2) the tools would not provide contextual auto completions or useful type related information in general</div><div><br></div><div>I am sure that everyone would be less comfortable shipping a large codebase that didn’t go through all the type checks. Exactly the same reasoning applies to “local”. If it’s just a convention that is not enforced by the compiler, we lose a very useful way to verify code correctness. In addition to that, everything that is marked as “local” (or “_” in front of the name)  now shows up in code completions and adds noise and temptation to cut corners (often this would be “faster” functions that already assume certain things about the state that may generally not be true). There are plenty of discussions about Cocoa private APIs on the web where the only thing that is stopping people is whether using them will pass the app store check (and if there is a secret back door still). That specific boundary is addressed with “internal”, but the same is true at the scale of a class.</div><div><br><div><div><div><blockquote type="cite"><div>On Jan 25, 2016, at 11:22 PM, Rob Mayoff via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><div><div dir="ltr"><div class="gmail_extra">I agree with everything Matthew Johnson said in his response. In addition:</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 25, 2016 at 5:40 PM, Taras Zakharko 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Personally, I use it quite often because of the way I like to design things as groups of tightly interdependent components (friends, if you want) who are aware of each other’s inner workings. I also want to have full access to the interface of any project I work on because I trust myself to make the judgement whether I am allowed to use a particular functionality or not.</blockquote></div><br></div><div class="gmail_extra">By this logic, you don&#39;t want or need private (Swift&#39;s private-to-file) either. You just want/need internal and public, because you trust your judgement and you want access to everything in the project.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I trust my judgement, but I don&#39;t trust my memory. In six months, I won&#39;t remember every detail of the code I wrote today. Private-to-file is a message from past-me to future-me: &quot;Dear future-Rob, you don&#39;t need to worry about looking for any use of this element outside this file, but if you want to make it visible to other files, you better study it to make sure it&#39;s safe to expose. Warmest regards, past-Rob.&quot;</div><div class="gmail_extra"><br></div><div class="gmail_extra">This is a useful message. It helps jog future-Rob&#39;s memory, it saves future-Rob from bugs, and it lets past-Rob rest easy because the message is guaranteed to be delivered, and is guaranteed to be correct. No comment or policy or convention can make that guarantee.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I want the ability to send another useful message: &quot;Dear future-Rob, you don&#39;t need to worry about looking for any use of this element outside this class, but if you want to make it visible to other classes, you better study it to make sure it&#39;s safe to expose. Very truly yours, past-Rob.&quot;</div><div class="gmail_extra"><br></div><div class="gmail_extra">Note that moving a private class to its own file to make its privates more private does not work. Now I have to make the formerly-private class an internal class, so I&#39;m not sending the first message anymore.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I&#39;m not arguing that Swift needs, say, Scala&#39;s level of detail in its access modifiers, but I think an access modifier for private-to-class or private-to-instance or private-to-scope would let past-Rob convey useful information to future-Rob in a lot of places where currently the information is less precise or entirely absent, and that this ability is useful enough to justify the additional language complexity.</div><div class="gmail_extra"><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" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></blockquote></div><br></div></div></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" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></blockquote></div><br></div></div></blockquote></div><br></div></div></blockquote></div><br></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" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></blockquote></div><br></div></blockquote></div>