<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 Apr 12, 2017, at 3:15 PM, Nevin Brackett-Rozinsky 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=""><div class="">In order to evaluate this proposal, I created a table of as many relevant scenarios as I could think of, and listed how each of the proposed solutions would work there. The four access level systems I compared are:</div><div class=""><br class=""></div><div class=""><b class="">No change:</b> The existing Swift 3 <i class="">status quo</i> with “fileprivate” and “private”.</div><div class=""><br class=""></div><div class=""><b class="">SE–0159:</b> Revert to the Swift 2 meaning of “private” (file visibility) and eliminate scoped access altogether.</div><div class=""><br class=""></div><div class=""><b class="">SE–0169:</b> Expand “private” to include the current type and all its extensions in the same file.</div><div class=""><br class=""></div><div class=""><b class="">Rename:</b> Change the spelling of “private” to “scoped”, and “fileprivate” to “private”.</div><div class=""><br class=""></div><div class="">I ended up with a list of eight scenarios to evaluate. These are:</div><div class=""><br class=""></div><div class="">1. “Simple file”, a single type with no extensions.</div><div class="">2. “Extensions”, a single type and extensions thereof.</div><div class="">3. “Sharing”, multiple types that need privileged access to each other.</div><div class="">4. “Helper visible”, the interface of a helper (or nested) type for use within the file.</div><div class="">5. “Helper hidden”, the details of a helper type that should not be visible to other types.</div><div class="">6. “Invariants”, the details of a type that should only be touched by dedicated methods.</div><div class="">7. “Multi-type”, multiple types that should not have privileged access to each other.</div><div class="">8. “Multi-type + ext”, multiple types that should not have privileged access to each other, and extensions thereof.</div><div class=""><br class=""></div><div class="">The entries in the table have seven possible values:</div><div class=""><br class=""></div><div class=""><b class="">private:</b> The “private” keyword works.</div><div class=""><br class=""></div><div class=""><b class="">fileprivate:</b> The “fileprivate” keyword works.</div><div class=""><br class=""></div><div class=""><b class="">scoped:</b> The “scoped” keyword works.<br class=""></div><div class=""><b class=""><br class=""></b></div><div class=""><b class="">private x2:</b> The “private” keyword works if the types are put into separate files.<br class=""></div><div class=""><br class=""></div><div class=""><b class="">fileprivate x2:</b> The “fileprivate” keyword works if the types are put into separate files.</div><div class=""><br class=""></div><div class=""><b class="">helper type:</b> The goal can only be achieved by creating a helper type.</div><div class=""><br class=""></div><div class=""><b class="">no hiding:</b> The specified items cannot be hidden from the rest of the file.<br class=""><br class="">Here is the completed and color-coded table (I hope it displays properly in this email):</div><div class=""><br class=""></div><div class=""><br class=""><table cellspacing="0" cellpadding="0" style="border-collapse:collapse" class="">
<tbody class="">
<tr class="">
<td valign="top" style="width:135px;height:20px;background-color:rgb(190,192,191);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; font-variant-numeric: normal; font-size: 12px; line-height: normal; font-family: helvetica; min-height: 14px;" class=""><br class=""></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(190,192,191);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class=""><b class="">No change</b></font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(190,192,191);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class=""><b class="">SE–0159</b></font></div>
</td>
<td valign="top" style="width:107px;height:20px;background-color:rgb(190,192,191);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class=""><b class="">SE–0169</b></font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(190,192,191);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class=""><b class="">Rename</b></font></div>
</td>
</tr>
<tr class="">
<td valign="top" style="width:135px;height:20px;background-color:rgb(220,220,220);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class=""><b class="">Simple file</b></font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(34,184,24);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private</font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(34,184,24);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private</font></div>
</td>
<td valign="top" style="width:107px;height:20px;background-color:rgb(34,184,24);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private</font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(34,184,24);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private</font></div>
</td>
</tr>
<tr class="">
<td valign="top" style="width:135px;height:19px;background-color:rgb(220,220,220);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class=""><b class="">Extensions</b></font></div>
</td>
<td valign="top" style="width:106px;height:19px;background-color:rgb(255,222,3);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">fileprivate</font></div>
</td>
<td valign="top" style="width:106px;height:19px;background-color:rgb(34,184,24);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private</font></div>
</td>
<td valign="top" style="width:107px;height:19px;background-color:rgb(34,184,24);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private</font></div>
</td>
<td valign="top" style="width:106px;height:19px;background-color:rgb(34,184,24);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private</font></div>
</td>
</tr>
<tr class="">
<td valign="top" style="width:135px;height:20px;background-color:rgb(220,220,220);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class=""><b class="">Sharing</b></font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(255,222,3);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">fileprivate</font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(34,184,24);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private</font></div>
</td>
<td valign="top" style="width:107px;height:20px;background-color:rgb(255,222,3);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">fileprivate</font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(34,184,24);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private</font></div>
</td>
</tr>
<tr class="">
<td valign="top" style="width:135px;height:20px;background-color:rgb(220,220,220);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class=""><b class="">Helper visible</b></font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(255,222,3);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">fileprivate</font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(34,184,24);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private</font></div>
</td>
<td valign="top" style="width:107px;height:20px;background-color:rgb(255,222,3);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">fileprivate</font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(34,184,24);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private</font></div>
</td>
</tr>
<tr class="">
<td valign="top" style="width:135px;height:20px;background-color:rgb(220,220,220);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class=""><b class="">Helper hidden</b></font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(34,184,24);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private</font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(255,60,0);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">no hiding</font></div>
</td>
<td valign="top" style="width:107px;height:20px;background-color:rgb(34,184,24);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private</font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(93,224,230);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">scoped</font></div>
</td>
</tr>
<tr class="">
<td valign="top" style="width:135px;height:20px;background-color:rgb(220,220,220);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class=""><b class="">Invariants</b></font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(34,184,24);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private</font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(255,60,0);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">no hiding</font></div>
</td>
<td valign="top" style="width:107px;height:20px;background-color:rgb(255,95,227);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">helper type</font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(93,224,230);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">scoped</font></div>
</td>
</tr>
<tr class="">
<td valign="top" style="width:135px;height:19px;background-color:rgb(220,220,220);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class=""><b class="">Multi-type</b></font></div>
</td>
<td valign="top" style="width:106px;height:19px;background-color:rgb(34,184,24);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private</font></div>
</td>
<td valign="top" style="width:106px;height:19px;background-color:rgb(160,238,118);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private x2</font></div>
</td>
<td valign="top" style="width:107px;height:19px;background-color:rgb(34,184,24);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private</font></div>
</td>
<td valign="top" style="width:106px;height:19px;background-color:rgb(93,224,230);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">scoped</font></div>
</td>
</tr>
<tr class="">
<td valign="top" style="width:135px;height:20px;background-color:rgb(220,220,220);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class=""><b class="">Multi-type + ext</b></font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(255,147,0);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">fileprivate x2</font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(160,238,118);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private x2</font></div>
</td>
<td valign="top" style="width:107px;height:20px;background-color:rgb(34,184,24);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private</font></div>
</td>
<td valign="top" style="width:106px;height:20px;background-color:rgb(160,238,118);border-style:solid;border-width:1px;border-color:rgb(0,0,0);padding:4px" class=""><div style="margin: 0px; text-align: center;" class=""><font face="Source Sans Pro" style="font-variant-numeric: normal; font-size: 16px; line-height: normal; font-family: 'source sans pro'; -webkit-font-kerning: none; font-variant-ligatures: common-ligatures;" class="">private x2</font></div>
</td>
</tr>
</tbody>
</table></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><b class="">Analysis</b></div><div class=""><br class=""></div><div class="">Some people have said on-list that they view cross-type sharing as an anti-pattern. If that is true, then we can simply ignore the “Sharing” row because it would not be worth optimizing for. This hardly changes the table though, as that row is identical to the “Helper visible” row below it.</div><div class=""><br class=""></div><div class="">Regarding the “Invariants” row, note that a helper type can be used for this purpose under “No change” and “Rename” just as well as under “SE–0169”. The difference is that SE-0169 provides no other way to hide invariants from the rest of the type, whereas the other two have an access level suited to the purpose. Similarly, the multi-type rows can be satisfied by separate files regardless of which access system is in place.</div><div class=""><br class=""></div><div class="">If a person takes the view that things in the same file should naturally have access to one another, then the bottom four rows of the table can be ignored. Such a person might have the mantra, “Only put things together if they belong together”, and they would ask, “What else is in the file that you are trying to hide from?”</div><div class=""><br class=""></div><div class="">For someone whose primary use-case is to put one type in a file and build it up through extensions, the “Extension” row is of greatest concern. To them, any of SE–0159, SE–0169, or renaming would let them use “private” instead of “fileprivate” everywhere.</div><div class=""><br class=""></div><div class="">As a final remark, each of the four options has one notable benefit and one notable drawback, not all of which are apparent from the above table:</div><div class=""><div class=""><br class=""></div><div class=""><div class=""><b class="">No change</b></div><div class="">Benefit: No change to the language.</div><div class="">Drawback: Must use “fileprivate” to build up a type through extensions.</div><div class=""><br class=""></div><div class=""><b class="">SE–0159</b></div><div class="">Benefit: Simplifies the access control model.</div><div class="">Drawback: Cannot protect invariants within a file.</div><div class=""><br class=""></div><div class=""><b class="">SE–0169</b></div><div class="">Benefit: Cross-type sharing is clearly marked.</div><div class="">Drawback: Must use a helper type to protect invariants within a file.</div></div></div></div></div></blockquote><div><br class=""></div><div>FWIW, a secondary drawback to SE-0169 is that the protection afforded by this helper type is permeable - the helper type can be extended anywhere inside the file. It is more than SE-0159 but not as strong a guarantee as either no change or rename. Extensions to the helper type will stand out much more clearly than inadvertent use of a `private` member under SE-0159 but readers still need to know they don’t exist or look for them to be sure.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><br class=""></div><div class=""><b class="">Rename</b></div><div class="">Benefit: No change to semantics.</div><div class="">Drawback: Two separate keywords are changed.</div></div></div><div class=""><br class=""></div><div class=""> • • •</div><div class=""><br class=""></div><div class="">And now, having said all that, I need to go take a nap!<br class=""></div><div class=""><br class=""></div><div class="">Once everything has percolated, I’ll come back to write a review of the current proposal.</div><div class=""><br class=""></div><div class="">Nevin</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>