<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=""><blockquote type="cite" class="">On Mar 21, 2017, at 9:17 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>&gt; wrote:<br class=""></blockquote><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On Tue, Mar 21, 2017 at 8:31 PM, Charles Srstka<span class="Apple-converted-space">&nbsp;</span></span><span dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">&lt;<a href="mailto:cocoadev@charlessoft.com" target="_blank" class="">cocoadev@charlessoft.com</a>&gt;</span><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><span class="Apple-converted-space">&nbsp;</span></span><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="gmail_quote"><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;"><div style="word-wrap: break-word;" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Mar 21, 2017, at 8:15 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class="m_-8549773196041780473Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline !important;" class="">On Tue, Mar 21, 2017 at 8:00 PM, Charles Srstka<span class="m_-8549773196041780473Apple-converted-space">&nbsp;</span></span><span dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">&lt;<a href="mailto:cocoadev@charlessoft.com" target="_blank" class="">cocoadev@charlessoft.<wbr class="">com</a>&gt;</span><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline !important;" class=""><span class="m_-8549773196041780473Apple-converted-space">&nbsp;</span></span><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline !important;" class="">wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><div class="gmail_extra" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div class="gmail_quote"><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;"><div style="word-wrap: break-word;" class=""><span class=""><blockquote type="cite" class="">On Mar 21, 2017, at 7:49 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>&gt; wrote:<br class=""></blockquote></span><div class=""><span class=""><blockquote type="cite" class=""><br class="m_-8549773196041780473m_5268141798906625724Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline !important;" class="">On Tue, Mar 21, 2017 at 6:46 PM, Charles Srstka<span class="m_-8549773196041780473m_5268141798906625724Apple-converted-space">&nbsp;</span></span><span dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">&lt;<a href="mailto:cocoadev@charlessoft.com" target="_blank" class="">cocoadev@charlessoft.c<wbr class="">om</a>&gt;</span><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline !important;" class=""><span class="m_-8549773196041780473m_5268141798906625724Apple-converted-space">&nbsp;</span></span><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline !important;" class="">wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><div class="gmail_extra" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div class="gmail_quote"><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;"><div style="word-wrap: break-word;" class=""><span class=""><blockquote type="cite" class="">On Mar 21, 2017, at 5:26 PM, Xiaodi Wu via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""></blockquote><div class=""><blockquote type="cite" class=""><br class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">So, if four/five access modifiers are too many, which one is carrying the least weight? Which one could be removed to simplify the scheme while maintaining the most expressiveness? Which one doesn't fulfill even its own stated goals? Well, one of the key goals of `private` was to allow members to be encapsulated within an extension, hidden even from the type being extended (and vice versa for members defined in the type). It says so in the first sentence of SE-0025. As seen above in my discussion with Charles Srstka, even supporters of `private` disagree with that motivation to begin with. The kicker is, _it also doesn't work_. Try, for instance:</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">```</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(186, 45, 162);" class="">struct</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span>Foo {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: menlo; color: rgb(186, 45, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;<span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span></span><span style="font-variant-ligatures: no-common-ligatures;" class="">private</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span></span><span style="font-variant-ligatures: no-common-ligatures;" class="">var</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span>bar:<span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">Int</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span>{<span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span></span><span style="font-variant-ligatures: no-common-ligatures;" class="">retur<wbr class="">n</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);" class="">42</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span>}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: menlo; color: rgb(186, 45, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">extension</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Foo</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span>{</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: menlo; color: rgb(186, 45, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;<span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span></span><span style="font-variant-ligatures: no-common-ligatures;" class="">private</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span></span><span style="font-variant-ligatures: no-common-ligatures;" class="">var</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span>bar:<span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">Int</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span>{<span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span></span><span style="font-variant-ligatures: no-common-ligatures;" class="">retur<wbr class="">n</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);" class="">43</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space">&nbsp;</span>}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">```</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">The code above should compile and does not. If I understood correctly the explanation from a core team member on this list, it's unclear if it can be made to work without changing how mangling works, which I believe impacts ABI and is not trivial at all. Thus, (a) even proponents of new `private` disagree on one of two key goals stated for new `private`; (b) that goal was never accomplished, and making it work is not trivial; (c) no one even complained about it, suggesting that it was a low-yield goal in the first place.</div></div></blockquote></div><br class=""></span><div class="">Multiple people have already brought up cases in which they are using ‘private’. The repeated mention of another, unrelated use case that was mentioned in the SE-0025 proposal does not invalidate the real-world use cases which have been presented. In fact, it rather makes it appear as if the motivation to remove ‘private’ is based on a strange invocation of the appeal-to-authority fallacy, rather than an actual improvement to the language.</div></div></blockquote><div class=""><br class=""></div><div class="">I'm not sure how to respond to this. SE-0025, as designed, is not fully implemented. And as I said above, IIUC, it cannot be fully implemented without ripping out a lot of mangling code that is unlikely to be ripped out before Swift 4. _And there is no evidence that anyone cares about this flaw; in fact, you are saying as much, that you do not care at all!_ If this is not sufficient indication that the design of SE-0025 does not fit with the overall direction of Swift, what would be?</div></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">Because there are other uses cases for ‘private', *not* involving extensions, which I *do* care about. The fact that part of the proposal was badly written (and really, that’s all this is</div></div></div></blockquote><div class=""><br class=""></div><div class="">Huh? The code above *should compile*--that is a primary aim for SE-0025. It does not compile and there is not a timeline (afaict) for its compiling. It does not bother you that the 25th proposal considered in the Swift evolution process, already once revised, is not fully implemented and may never be?</div></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">Someone finding a bug/oversight in the compiler behavior does not compel me to throw out the baby with the bathwater, no.</div></div></div></blockquote><div class=""><br class=""></div><div class="">You're not hearing the argument. No one "accidentally" included this design as part of SE-0025; it's sentence number one.</div></div></div></div></blockquote></div><br class=""><div class="">Or not. Here’s the actual text of the introductory paragraph:</div><div class=""><br class=""></div><div class="">"Scoped access level allows hiding implementation details of a class or a class extension at the class/extension level, instead of a file. It is a concise expression of the intent that a particular part of a class or extension definition is there only to implement a public API for other classes or extensions and must not be used directly anywhere outside of the scope of the class or the extension.”</div><div class=""><br class=""></div><div class="">So here we have “class or extension”, or some variant thereof, five separate times. It honestly reads like it originally just said “class”, and the author systematically went through it and added “or extension” to each of them to make sure his/her bases were covered. And didn’t quite succeed; the wording doesn’t account for value types.</div><div class=""><br class=""></div><div class="">And anyway, I’m not sure how you even get “extensions should be able to shadow private members” as Priority Number One™, based on that sentence. Which part of the sentence does your code example violate? The sentence says that implementation details are hidden, and so they are. The struct can’t access the extension’s private members, or vice versa. The name-mangling issue that causes the compiler to choke is simply a *bug*, an unintended consequence that the author didn’t consider. And as I said before, I’d be perfectly fine with striking all the “or extension”s from that paragraph and having ‘private’ only restrict things inside the types themselves (within a module, of course). Or, just fixing the mangling so that works. Honestly, I don’t understand what kind of point the above is supposed to make, other than pointing fingers and laughing at somebody for making a mistake.</div><div class=""><br class=""></div><div class="">Charles</div><div class=""><br class=""></div></body></html>