<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 13 Feb 2017, at 17:21, Adrian Zubarev 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=""><div class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; 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; background-color: rgb(254, 254, 254);"><p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">People talk always like “I never liked<span class="Apple-converted-space">&nbsp;</span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">fileprivate</code>” and I feel like some of you forgot that<span class="Apple-converted-space">&nbsp;</span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">fileprivate</code><span class="Apple-converted-space">&nbsp;</span>is not new to Swift. It’s the repainted<span class="Apple-converted-space">&nbsp;</span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">private</code><span class="Apple-converted-space">&nbsp;</span>from days before Swift 3. I cannot recall anyone complaining about it that much. There were some people that forced the addition of a stricter<span class="Apple-converted-space">&nbsp;</span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">private</code><span class="Apple-converted-space">&nbsp;</span>access modifier for Swift 3. Now that we have both, there are a lot of complains about<span class="Apple-converted-space">&nbsp;</span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">fileprivate</code>.</p><div style="margin: 15px 0px;" class=""><br class="webkit-block-placeholder"></div></div></div></blockquote>It _is_ kind of ugly. I would support rearranging our access lives like this, with a parameterised “private”:</div><div><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div><font face="Courier" class="">open</font></div><div><font face="Courier" class="">public</font></div><div><font face="Courier" class="">private(module) // today’s “internal”</font></div><div><font face="Courier" class="">private(file) &nbsp; // today’s “fileprivate”</font></div><div><font face="Courier" class="">private &nbsp; &nbsp; &nbsp; &nbsp; // today’s “private”</font></div></blockquote><div><br class=""></div><div>It also opens the door to more nuanced access levels, such as private(type) to allow access to the hidden member in cross-file extensions but not generally throughout the module.</div><br class=""><div class="">For properties, it would mean&nbsp;</div><div class=""><font face="Courier" class=""><br class=""></font></div><div class=""><font face="Courier" class="">public internal(set) var something: Bool</font></div><div class=""><br class=""></div><div class="">would become&nbsp;</div><div class=""><font face="Courier" class=""><br class=""></font></div><div class=""><font face="Courier" class="">public private(module, set) var something: Bool</font></div><div class=""><font face="Courier" class=""><br class=""></font></div><div class="">at which point it might be nicer to flip the arguments and call it&nbsp;“setter”:</div><div class=""><font face="Courier" class=""><br class=""></font></div><div class=""><span style="font-family: Courier;" class="">public private(setter, module) var something: Bool</span></div><div class=""><span style="font-family: Courier;" class=""><br class=""></span></div><div class="">- Karl</div></body></html>