<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 Jun 15, 2016, at 4:27 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div 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="">On Wed, Jun 15, 2016 at 4:14 PM, Matthew Johnson<span class="Apple-converted-space">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:matthew@anandabits.com" target="_blank" class="">matthew@anandabits.com</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br class=""><div class="gmail_extra"><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 Jun 15, 2016, at 4:08 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">On Wed, Jun 15, 2016 at 3:09 PM, Matthew Johnson<span class="">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:matthew@anandabits.com" target="_blank" class="">matthew@anandabits.com</a>&gt;</span><span class="">&nbsp;</span>wrote:<br class=""><div class="gmail_extra"><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 Jun 15, 2016, at 2:55 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">On Wed, Jun 15, 2016 at 2:48 PM, Matthew Johnson via swift-evolution<span class="">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span>wrote:<br class=""><div class="gmail_extra"><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 Jun 15, 2016, at 2:46 PM, Adrian Zubarev via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class=""><div class=""><div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><p style="margin: 15px 0px;" class="">I was referencing to the issue Robert discovered in his implementation.<span class="">&nbsp;</span></p><p style="margin: 15px 0px;" class="">I do understand what the proposal is all about, but thank you for re-clarifying that to me. :)</p><div class=""><br class=""></div></div></div></blockquote><div class=""><br class=""></div></span>I don’t think it’s a bug, but it is definitely something that isn’t as clear as it should have been.<br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">Was it intentional on the part of the proposal, then, that there should be two modifiers meaning the same thing for a top level declaration in a file? Or was it intended that only one or the other be used in that scenario?</div></div></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">I don’t think it was carefully considered, although I think it did come up at some point during discussion in the context of compatibility with existing code (i.e. nothing changes for current top-level `private` declarations). &nbsp;</div><div class=""><br class=""></div><div class="">It is in some sense a “coincidence” that they mean the same thing at file scope.&nbsp; The proposal would have had to introduce a specific prohibition to prevent this situation and it did not do so.&nbsp; That said, I think this kind of issue falls well within the discretion of the core team to make a call without violating the spirit of the proposal.</div><div class=""><br class=""></div><div class="">There are two reasonable options here:&nbsp;</div><div class=""><br class=""></div><div class="">1. Allow both `private` and `fileprivate` at file scope despite the fact that they have the same meaning.&nbsp; This is more consistent in the sense that we are not introducing a special case that arbitrarily prohibits an otherwise valid access modifier.&nbsp; It also means that nothing needs to change for top level `private` declarations in existing code.</div><div class=""><br class=""></div><div class="">2. Prohibit `private` at file scope.&nbsp; Given that it appears as if the behavior of `private` at file scope may not be intuitive and is equivalent to `fileprivate` it might be reasonable to just disallow it.&nbsp; This would result in more consistent *code* (even if there needs to be a special case in the language).</div><div class=""><br class=""></div>I don’t have a strong opinion on which option we choose.&nbsp; But I do feel strongly that the semantics of `private` need to properly respect the scope in which the keyword is written and into which the associated declaration is introduced (rather than the scope *inside* the declaration it is attached to).</div></div></blockquote><div class=""><br class=""></div><div class="">Right, I think both would be OK. More radically, we might want to re-evaluate the continued utility of a `fileprivate` scope. It seems the use cases for such a scope not adequately served by either `internal` or the new `private` would be exceedingly rare.</div></div></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">I disagree with that. &nbsp;`fileprivate` is indispensable when you need it.&nbsp; There are times when you want to keep visibility limited to the current file but the new `private` is too restrictive (for example, you need to access a member of one type in a closely related extension of a different type that lives in the same file).</div></div></div></blockquote><div class=""><br class=""></div><div class="">Sure. This was more of a thought for the future. As we move towards fully embracing a scope-based model for organizing code, modules will no longer need to be strictly "single units of code distribution," and a move towards supporting submodules could serve your use case without `fileprivate`. That, IMO, would be a logical endpoint of moving from file-based access to scope-based access.</div></div></div></div></div></blockquote><div><br class=""></div><div>I would really like to see submodules, but I think there would still be valid uses for `fileprivate` even with them. &nbsp;But of course we would need to know the details of submodules to have a good discussion about that so it’s a topic for the future. :)</div><br class=""><blockquote type="cite" class=""><div class=""><div 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=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><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=""><span class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: 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"><div class="gmail_quote"><div class="">&nbsp;</div><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=""><font color="#888888" class=""><div class=""></div></font></span><div class=""><span class=""><font color="#888888" class="">-Matthew</font></span><span class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: 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"><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=""><blockquote type="cite" class=""><div class=""><span class=""><div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><div style="margin: 15px 0px;" class=""><br class=""></div></div><div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class=""><br class=""></div><br class=""><div class=""><div style="font-family: helvetica, arial; font-size: 13px;" class="">--&nbsp;<br class="">Adrian Zubarev<br class="">Sent with Airmail</div></div><br class=""><p style="margin: 15px 0px;" class="">Am 15. Juni 2016 um 21:40:37, Matthew Johnson (<a href="mailto:matthew@anandabits.com" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">matthew@anandabits.com</a>) schrieb:</p><blockquote type="cite" style="margin: 15px 0px;" class=""><span style="margin-top: 0px; margin-bottom: 0px;" class=""><div class=""><div style="font-family: 'helvetica Neue', helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">What seems like a nasty bug missed during review?&nbsp; I don’t follow you there.</div><div style="font-family: 'helvetica Neue', helvetica; font-size: 14px; font-style: 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 Neue', helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">This proposal was specifically designed to follow Swift’s design of a scope-based access control mechanism rather than a type-based access control mechanism that is common in other languages.</div></div></span></blockquote></div><div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><div style="margin: 15px 0px;" class=""><br class=""></div></div></span><span class=""><span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><a href="mailto:swift-evolution@swift.org" target="_blank" style="color: rgb(65, 131, 196); background-color: rgb(254, 254, 254); text-decoration: none; font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">swift-evolution@swift.org</a><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" style="color: rgb(65, 131, 196); background-color: rgb(254, 254, 254); text-decoration: none; font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""></span></div></blockquote></div><br class=""></div><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></blockquote></div></div></div></div></blockquote></span></div></div></blockquote></div></div></div></div></blockquote></span></div></div></blockquote></div></div></div></div></blockquote></div><br class=""></body></html>