<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On Jul 13, 2016, at 10:26 AM, Xiaodi Wu via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><div class="">As Jordan mentioned, I don't (and I think other people don't) think of extensions as their own entities, as they can't be referred to and have no runtime representation. In that mental model, there isn't such a thing as "an extension being public." Instead, the access modifier is just a shorthand default for the properties and methods it contains, which is teachable but unique to extensions. It is a matter of opinion whether that uniqueness is a feature or a bug.<br class=""></div></blockquote><div><br class=""></div>I would say that it's interesting but ultimately not worth the confusion about the nature of extensions.</div><div><br class=""></div><div>John.</div><div><br class=""><blockquote type="cite" class=""><div class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Wed, Jul 13, 2016 at 12:19 Jose Cheyo Jimenez <<a href="mailto:cheyo@masters3d.com" class="">cheyo@masters3d.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto" class=""><div class=""></div><div class=""><br class=""></div><div class=""><br class="">On Jul 13, 2016, at 8:46 AM, Xiaodi Wu via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Jul 13, 2016 at 4:04 AM, Rod Brown via swift-evolution <span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">Proposal link: <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0119-extensions-access-modifiers.md" target="_blank" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0119-extensions-access-modifiers.md</a></div><div class=""><br class=""></div><div class=""><span class=""><blockquote type="cite" class=""><span style="white-space:pre-wrap" class="">        </span>* What is your evaluation of the proposal?<br class=""></blockquote></span><div class="">-1. Extensions appear to me to follow the access control of the rest of Swift: Implicit to the type you are extending, and you can either / both declare as part of the extension declaration or on the method. I don’t see how this is confusing, and I expect people will be more confused that extensions don’t follow the convention of the rest of Swift for Access Control.</div></div></div></blockquote><div class=""><br class=""></div><div class="">So, actually, the proposal is correct that extensions (at least once fileprivate/private is implemented) don't follow the access control rules for the rest of Swift. There is a problem to be addressed. However, I agree that this proposal hasn't identified the issue or adequately explained how the solution solves it. Here's the problem I'm thinking of:</div><div class=""><br class=""></div><div class="">```</div><div class="">public struct foo {</div><div class=""> func frobnicate() { } // implicitly internal</div><div class="">}</div><div class=""><br class=""></div><div class="">public struct bar { }</div><div class="">public extension bar {</div><div class=""> func frobnicate() { } // implicitly public</div><div class=""> // at least, according to the revised rules explained in SE-0025</div><div class="">}</div><div class="">```</div></div></div></div></div></blockquote><div class=""><br class=""></div></div><div dir="auto" class=""><div class="">There is definitely a difference, I think that is a good thing. <span style="background-color:rgba(255,255,255,0)" class="">They look similar but they are completely different. </span></div><div class=""><br class=""></div><div class="">public Type // the type is public</div><div class="">public extension Type // the extension is public </div><div class=""><br class=""></div><div class="">For extensions, public is just a modifier on extension, not the type. The default scope inside the extension is that of the "modifier" keyword on the extension. </div><div class=""><br class=""></div><div class="">This is easy to explain to someone new. </div></div><div dir="auto" class=""><div class=""><br class=""></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="">This is an inconsistency that may (and IMO, really is) worth addressing. If there's adequate interest, I can circulate a draft with a proposed solution I have in mind.</div><div class=""> </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" class=""><div class=""><span class=""><br class=""><blockquote type="cite" class=""><span style="white-space:pre-wrap" class="">        </span>* Is the problem being addressed significant enough to warrant a change to Swift?<br class=""></blockquote></span><div class="">I don’t think this warrants a change.</div><span class=""><br class=""><blockquote type="cite" class=""><span style="white-space:pre-wrap" class="">        </span>* Does this proposal fit well with the feel and direction of Swift?<br class=""></blockquote></span>No. This seems to go against the direction of Swift.</div><div class=""><span class=""><br class=""><blockquote type="cite" class=""><span style="white-space:pre-wrap" class="">        </span>* If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?<br class=""></blockquote></span><div class="">No.</div><span class=""><div class=""><br class=""></div><blockquote type="cite" class=""><span style="white-space:pre-wrap" class="">        </span>* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?</blockquote></span>A reading of the proposal.</div><div class=""><br class=""></div></div><br class="">_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
<br class=""></blockquote></div><br class=""></div></div>
</div></blockquote><blockquote type="cite" class=""><div class=""><span class="">_______________________________________________</span><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class=""></div></blockquote></div></blockquote></div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>