<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>IMHO this sounds more like portected access that is crippled to the same file. I've personally argued with large files (500-1500 lines of code) and to be honest, I've tried breaking those up into several files each focusing on some aspect of the class and often ran into issues that the methods were dependent on private members of the class that I did not want to make internal.</div><div><br></div><div>Seeing where the discussions go, I'd suggest eliminating fileprivate, private having the old behavior (file scoped) and introduce @protected annotation.</div><div><br></div><div>When a member is marked as @protected, it can be accessed only from the class/struct and its extensions. We can discuss access from subclasses.</div><div><br>15. 2. 2017 v&nbsp;8:05, David Hart via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt;:<br><br></div><blockquote type="cite"><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div><div><br><br>Sent from my iPhone</div>On 15 Feb 2017, at 06:31, Chris Lattner &lt;<a href="mailto:sabre@nondot.org">sabre@nondot.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 14, 2017, at 3:20 AM, David Hart &lt;<a href="mailto:david@hartbit.com" class="">david@hartbit.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class=""><br class=""></div><div class="">On 14 Feb 2017, at 09:25, Goffredo Marocchi &lt;<a href="mailto:panajev@gmail.com" class="">panajev@gmail.com</a>&gt; wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div class="">I disagree with that as well as I still think we are damaging the language each time we take a known concept (like access levels) and give new meanings to the same keywords. I still look baffled at the redefinition of do and the addition of repeat for example...</div><div class=""><br class=""></div><div class="">Private, the way it was before, was an admittedly curious take on how most languages mean by private and we have jumped through a lot of hoops to justify why we did not start with Java/C++/C# like access control and augmented it instead of redefining things, omitting others, and then constantly pulling the language left and right with not a lot of permanent consensus either way as this discussion and others before show.</div></div></blockquote><div class=""><br class=""></div><div class="">It's a curious take, but it is a curious take is perfectly coherent with Swift extensions. How else would you access private implementation details from an extension? But putting it in the same file, instead of having to resort to an internal access level.</div></div></div></blockquote><br class=""></div><div>Right. &nbsp;Swift is its own language distinct from Java/C++/etc. &nbsp;While it is intentionally designed to remain familiar (and thus reuses many keywords across the language family), it often does so with slightly different meaning / behavior. &nbsp;Consider ‘throw’ for example.</div><div><br class=""></div><div>Keeping with the spirit of Swift and staying consistent with its design, I see two plausible meanings for private:</div><div><br class=""></div><div>Private could mean either:</div><div>1) private to the file (Swift 2 semantics)</div><div>2) accessible only to the current type/scope and to extensions to that type that are in the current file.</div></div></blockquote><div><br></div><div>I think (2) is worth discussing. My 2 cents:</div><div><br></div><div><b>Pros</b></div><div>• Solves a high percentage of use cases of <b>fileprivate</b></div><div>• Type-scope proponents retain some of the safety</div><div><br></div><div><b>Cons</b></div><div>• Less straight forward to explain</div><div>• Access to different type/scope in same file not possible anymore</div><div><br></div><div>Honestly, I'd be quite happy about this compromise. :)</div><br><blockquote type="cite"><div><div>I don’t think we’ve ever evaluated and debated approach #2 systematically.</div><div><br class=""></div><div>-Chris</div><br class=""></div></blockquote></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>