<div dir="ltr">On Wed, Jun 15, 2016 at 4:14 PM, Matthew Johnson <span dir="ltr">&lt;<a href="mailto:matthew@anandabits.com" target="_blank">matthew@anandabits.com</a>&gt;</span> wrote:<br><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"><br><div><span class=""><blockquote type="cite"><div>On Jun 15, 2016, at 4:08 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br><div><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">On Wed, Jun 15, 2016 at 3:09 PM, Matthew Johnson<span> </span><span dir="ltr">&lt;<a href="mailto:matthew@anandabits.com" target="_blank">matthew@anandabits.com</a>&gt;</span><span> </span>wrote:<br><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"><br><div><span><blockquote type="cite"><div>On Jun 15, 2016, at 2:55 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br><div><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">On Wed, Jun 15, 2016 at 2:48 PM, Matthew Johnson via swift-evolution<span> </span><span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span>wrote:<br><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"><br><div><span><blockquote type="cite"><div>On Jun 15, 2016, at 2:46 PM, Adrian Zubarev via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><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)"><p style="margin:15px 0px">I was referencing to the issue Robert discovered in his implementation.<span> </span></p><p style="margin:15px 0px">I do understand what the proposal is all about, but thank you for re-clarifying that to me. :)</p><div><br></div></div></div></blockquote><div><br></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></div></div></blockquote><div><br></div><div>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><br></div></span><div>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).  </div><div><br></div><div>It is in some sense a “coincidence” that they mean the same thing at file scope.  The proposal would have had to introduce a specific prohibition to prevent this situation and it did not do so.  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><br></div><div>There are two reasonable options here: </div><div><br></div><div>1. Allow both `private` and `fileprivate` at file scope despite the fact that they have the same meaning.  This is more consistent in the sense that we are not introducing a special case that arbitrarily prohibits an otherwise valid access modifier.  It also means that nothing needs to change for top level `private` declarations in existing code.</div><div><br></div><div>2. Prohibit `private` at file scope.  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.  This would result in more consistent *code* (even if there needs to be a special case in the language).</div><div><br></div>I don’t have a strong opinion on which option we choose.  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><br></div><div>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><br></div></span><div>I disagree with that.  `fileprivate` is indispensable when you need it.  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><br></div><div>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 &quot;single units of code distribution,&quot; 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><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span class=""><br><blockquote type="cite"><div><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"><div class="gmail_extra"><div class="gmail_quote"><div> </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"><span><font color="#888888"><div></div></font></span><div><span><font color="#888888">-Matthew</font></span><span><br><blockquote type="cite"><div><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"><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"><div><blockquote type="cite"><div><span><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)"><div style="margin:15px 0px"><br></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)"><div style="font-family:Helvetica,Arial;font-size:13px;margin:0px"><br></div><br><div><div style="font-family:helvetica,arial;font-size:13px">-- <br>Adrian Zubarev<br>Sent with Airmail</div></div><br><p style="margin:15px 0px">Am 15. Juni 2016 um 21:40:37, Matthew Johnson (<a href="mailto:matthew@anandabits.com" style="color:rgb(65,131,196);background-color:inherit;text-decoration:none" target="_blank">matthew@anandabits.com</a>) schrieb:</p><blockquote type="cite" style="margin:15px 0px"><span style="margin-top:0px;margin-bottom:0px"><div><div style="font-family:&#39;helvetica Neue&#39;,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">What seems like a nasty bug missed during review?  I don’t follow you there.</div><div style="font-family:&#39;helvetica Neue&#39;,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"><br></div><div style="font-family:&#39;helvetica Neue&#39;,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">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)"><div style="margin:15px 0px"><br></div></div></span><span><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">_______________________________________________</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)"><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">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)"><a href="mailto:swift-evolution@swift.org" 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" target="_blank">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)"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" 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" target="_blank">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)"></span></div></blockquote></div><br></div><br>_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">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><br></div></blockquote></div><br></div></div>