<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 30, 2017, at 11:19 AM, Mike Kluev &lt;<a href="mailto:mike.kluev@gmail.com" class="">mike.kluev@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra">On 30 October 2017 at 18:07, Adam Kemp <span dir="ltr" class="">&lt;<a href="mailto:adam_kemp@apple.com" target="_blank" class="">adam_kemp@apple.com</a>&gt;</span> wrote:<br class=""><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space" class=""><div class=""><span class="gmail-"><blockquote type="cite" class=""><div class="">On Oct 30, 2017, at 10:57 AM, Mike Kluev &lt;<a href="mailto:mike.kluev@gmail.com" target="_blank" class="">mike.kluev@gmail.com</a>&gt; wrote:</div><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""></div><div class="gmail_extra">the new bucket would be "class and all of its extensions be them in the same file or in different files”.<br class=""></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">That’s not a new bucket. It is equivalent to either internal or public, depending on whether you want to extend this beyond the module boundary. The set of code you would have to audit is the same.</div></div></div></blockquote><div class=""><br class=""></div><div class="">it is different, see below:</div><div class=""><br class=""></div><div class="">=== file: Some.swift</div><div class=""><br class=""></div><div class="">class Some {</div><div class="">&nbsp; &nbsp;internal func foo() {</div><div class="">&nbsp; &nbsp; &nbsp; bar()</div><div class="">&nbsp; &nbsp;}</div><div class="">&nbsp; &nbsp;classprivate func better() {</div><div class="">&nbsp; &nbsp; &nbsp; good()</div><div class="">&nbsp; &nbsp; }</div><div class="">}</div><div class=""><br class=""></div><div class="">=== file: Some+Bar.swift</div><div class=""><br class=""></div><div class="">extension Some {</div><div class="">&nbsp; internal func bar() {</div><div class="">&nbsp; &nbsp; &nbsp; foo()</div><div class="">&nbsp; }</div><div class="">&nbsp; classprivate func good() {</div><div class="">&nbsp; &nbsp; &nbsp; better()</div><div class="">&nbsp; &nbsp;}</div><div class="">}</div><div class=""><br class=""></div><div class="">=== any other file (same module)</div><div class=""><br class=""></div><div class="">class Other {</div><div class="">&nbsp; &nbsp; func x() {</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; let some = Some()</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; some.foo() // ************** UNWANTED!!!!!!</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; some.better() // error. &nbsp;****** WANTED!</div><div class="">&nbsp; &nbsp; }</div><div class="">}</div></div></div></div></div></blockquote><div><br class=""></div><div>How do you know there’s not an extension in this file without looking? If you don’t know then you have to check. That puts it in the same bucket as internal or public. The set of files you have to search through for usages is the same.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><div class="">I do not want to audit the class Other when I make a change to "foo" or "bar", which are essentially "private" and only made "internal" because of the language limitation in regards to "private" vs "multi-file class" issue.</div><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space" class=""><div class=""><div class=""><br class=""></div><div class="">What does marking a method as “specialprivate” (my made up name for this new access level) tell clients about who can use it or how it can be used?</div></div></div></blockquote><div class=""><br class=""></div><div class="">it tells them: "you can't use this, unless you are writing an extension to this class or making changes to this class itself”</div></div></div></div></div></blockquote><div><br class=""></div><div>There’s nothing special about an extension. Anyone can write an extension to any class. You shouldn’t need any special privileges to enable people to write extensions. You’re not gaining anything by introducing an interface only usable by extensions.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><br class=""></div><div class="gmail_extra">Mike</div><div class="gmail_extra"><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>