<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>This use case has at least been brought up in discussions within my team. I wouldn't be surprised if it's actually deployed as well. Given a big project with enough experienced devs, I'd say this pattern is almost a certainty.<br><br><div>Daniel Duan</div>Sent from my iPhone</div><div><br>On Apr 6, 2017, at 6:53 PM, Brent Royal-Gordon via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div><blockquote type="cite" class=""><div class="">On Apr 6, 2017, at 5:38 PM, Charles Srstka via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><blockquote type="cite" class="">On Apr 6, 2017, at 7:34 PM, Xiaodi Wu via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""></blockquote><div class=""><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; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">`private` works for extensions exactly how the authors of SE-0025 intended it to do. Your comments do not address what would happen for those people who are making use of this functionality currently to isolate methods to the extension only.</span></div></blockquote></div><br class=""><div class="">Who is currently doing that?</div></div></div></blockquote><br class=""></div><div>Me.</div><div><br class=""></div><div>Even though I think we were better off without scoped `private`, I *have* used it fruitfully on several occasions. These were typically in places where I wanted to restrict access to a small number of members which I could ensure would enforce certain invariants. An example I gave previously involved two arrays which contained matching elements; code should never insert or remove from one array without doing the same to the other. By making these arrays `private` and exposing `fileprivate` and `public` members derived from them, I could ensure that only a couple dozen lines could possibly contain such a bug without changing the external design of the type or introducing boilerplate.</div><div><br class=""></div><div>This proposal does not offer the same utility. The only way to protect fragile parts of a type from other parts is to extract them into a separate type, and even then, you can extend that new type anywhere in the file to access the fragile parts. You're also likely to end up having members on the outer type which simply call into equivalent members on the inner type. It increases boilerplate and reduces protection.</div><div><br class=""></div><div>Despite having used scoped `private` in the past, if the choice were between keeping it and giving it `fileprivate` semantics, I would still support the latter; I think the simplification would be worth the loss of tight encapsulation. But this proposal offers *neither* simplification *nor* tight encapsulation, so I'm opposed to it.</div><br class=""><div class="">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><div class=""><div style="font-size: 12px; " class="">--&nbsp;</div><div style="font-size: 12px; " class="">Brent Royal-Gordon</div><div style="font-size: 12px; " class="">Architechies</div></div></span>

</div>
<br class=""></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>