<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 21, 2017, at 9:17 PM, Xiaodi Wu via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">On Tue, Mar 21, 2017 at 8:31 PM, Charles Srstka <span dir="ltr" class=""><<a href="mailto:cocoadev@charlessoft.com" target="_blank" class="">cocoadev@charlessoft.com</a>></span> wrote:<br class=""><div class="gmail_extra"><div class="gmail_quote"><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=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Mar 21, 2017, at 8:15 PM, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>> 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"> </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=""><<a href="mailto:cocoadev@charlessoft.com" target="_blank" class="">cocoadev@charlessoft.<wbr class="">com</a>></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"> </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 <<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>> 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"> </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=""><<a href="mailto:cocoadev@charlessoft.com" target="_blank" class="">cocoadev@charlessoft.c<wbr class="">om</a>></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"> </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 <<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>> 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"> </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=""> <span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space"> </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"> </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"> </span>bar:<span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space"> </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"> </span>{<span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space"> </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"> </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"> </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"> </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"> </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=""> <span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space"> </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"> </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"> </span>bar:<span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space"> </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"> </span>{<span class="m_-8549773196041780473m_5268141798906625724m_1779768077800158996Apple-converted-space"> </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"> </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"> </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. And no one just "forgot" to make the code above work; it simply can't be accommodated by the current mangling scheme. And--what's more--_no one seems to be bothered by it_. If the first sentence of a proposal can't be implemented, and no one cares (!), is the proposal fundamentally flawed or is it just some bug?</div></div></div></div></div></blockquote><div><br class=""></div><div>The reason nobody cares much is because this is a degenerate case and is not actually how people want to use the feature. You don’t see people writing identically named fileprivate methods in extensions of a type in different files either. The purpose of the feature is not shadowing. That is a side effect. The purpose is to provide tight compiler-verified encapsulation. Nothing more, nothing less.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><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=""><blockquote type="cite" class=""><div 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=""><div class=""><div class="">—it uses “class or extension” as a synonym for “any type declaration" when really, it makes just as much sense for structs to have private members as classes. Stuff happens!) does not invalidate the other use cases. And yes, I’m aware that my coding style may differ from other people, who may use the language in a different way. We shouldn’t break *their* use cases, either.</div></div></div></blockquote><div class=""><br class=""></div><div class="">We shouldn't break their use cases _without good reason_, but we shouldn't hesitate to break their use cases if (a) there is an extremely justifiable reason for it; and (b) the migration path is straightforward; and (preferably) also (c) the breakage is relatively uncommon. I happen to think those criteria are met for the reasons I've outlined extensively above, and you may certainly quibble with that conclusion</div></div></div></div></blockquote><br class=""></span></div><div class="">We’re simply going to have to disagree here.</div><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">Charles</div><div class=""><br class=""></div></font></span></div></blockquote></div><br class=""></div></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>