<div dir="ltr">For those who are considering this topic, the existing document here is a good resource:<div><a href="https://github.com/apple/swift/blob/master/docs/AccessControl.rst">https://github.com/apple/swift/blob/master/docs/AccessControl.rst</a></div><div>Note that &quot;class-only&quot; and &quot;protected&quot; access levels are specifically called out as non-goals for Swift, with accompanying justification. Perhaps those who disagree with the design could catalog warts that would be addressed with an alternative design?</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 3, 2016 at 1:46 PM, Xiaodi Wu <span dir="ltr">&lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">An interesting format. Since it&#39;s a list, I&#39;m not sure how to go about commenting on the items already there with which I disagree. IMO, the format doesn&#39;t lend itself to discussion.<div><br></div><div>For example, _why_ do you want friend classes? By contrast, it&#39;s been said on this list that not having them is considered a feature, and that friend classes are a mistake. Should I just go ahead and write &quot;not having the ability to list specific classes and functions that can access a property/function&quot; as a bullet point? It seems that&#39;s not very productive.</div><div><div class="h5"><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 3, 2016 at 10:59 AM, Jay Abbott <span dir="ltr">&lt;<a href="mailto:jay@abbott.me.uk" target="_blank">jay@abbott.me.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="m_-2580811094440566248m_7705193659913012554markdown-here-wrapper"><p style="margin:0px 0px 1.2em!important">No idea if this will be useful, or if it will work, but I created a public trello board:</p>
<p style="margin:0px 0px 1.2em!important"><a href="https://trello.com/b/fmv4uV3n/swift-access-control" target="_blank">https://trello.com/b/fmv4uV3n/<wbr>swift-access-control</a></p>
<ul style="margin:1.2em 0px;padding-left:2em">
<li style="margin:0.5em 0px">Pre-populated with a few of the things already mentioned.</li>
<li style="margin:0.5em 0px">There’s a link on the board to gain edit access.</li>
</ul>
<p style="margin:0px 0px 1.2em!important">It’s possible this will be an utter disaster, or that nobody will use it at all, so go ahead and add new lists/cards with abandon.</p>
<div title="MDH:PGRpdj5ObyBpZGVhIGlmIHRoaXMgd2lsbCBiZSB1c2VmdWwsIG9yIGlmIGl0IHdpbGwgd29yaywg
YnV0IEkgY3JlYXRlZCBhIHB1YmxpYyB0cmVsbG8gYm9hcmQ6PGJyPjxicj48YSBocmVmPSJodHRw
czovL3RyZWxsby5jb20vYi9mbXY0dVYzbi9zd2lmdC1hY2Nlc3MtY29udHJvbCI+aHR0cHM6Ly90
cmVsbG8uY29tL2IvZm12NHVWM24vc3dpZnQtYWNjZXNzLWNvbnRyb2w8L2E+PGJyPjxicj48L2Rp
dj48ZGl2PiogUHJlLXBvcHVsYXRlZCB3aXRoIGEgZmV3IG9mIHRoZSB0aGluZ3MgYWxyZWFkeSBt
ZW50aW9uZWQuPGJyPiogVGhlcmUncyBhIGxpbmsgb24gdGhlIGJvYXJkIHRvIGdhaW4gZWRpdCBh
Y2Nlc3MuPGJyPjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+SXQncyBwb3NzaWJsZSB0aGlzIHdp
bGwgYmUgYW4gdXR0ZXIgZGlzYXN0ZXIsIG9yIHRoYXQgbm9ib2R5IHdpbGwgdXNlIGl0IGF0IGFs
bCwgc28gZ28gYWhlYWQgYW5kIGFkZCBuZXcgbGlzdHMvY2FyZHMgd2l0aCBhYmFuZG9uLjxicj48
YnI+PC9kaXY+" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0">​</div></div></div><div class="m_-2580811094440566248HOEnZb"><div class="m_-2580811094440566248h5"><br><div class="gmail_quote"><div dir="ltr">On Fri, 2 Dec 2016 at 22:38 Xiaodi Wu via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Well, that&#39;s literally what I just mentioned above. I&#39;d be fine with getting rid of private and fileprivate.<br class="m_-2580811094440566248m_7705193659913012554gmail_msg"><div class="gmail_quote m_-2580811094440566248m_7705193659913012554gmail_msg"><div dir="ltr" class="m_-2580811094440566248m_7705193659913012554gmail_msg">On Fri, Dec 2, 2016 at 16:30 Jonathan Hull &lt;<a href="mailto:jhull@gbis.com" class="m_-2580811094440566248m_7705193659913012554gmail_msg" target="_blank">jhull@gbis.com</a>&gt; wrote:<br class="m_-2580811094440566248m_7705193659913012554gmail_msg"></div><blockquote class="gmail_quote m_-2580811094440566248m_7705193659913012554gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="m_-2580811094440566248m_7705193659913012554gmail_msg"><div class="m_-2580811094440566248m_7705193659913012554gmail_msg"><blockquote type="cite" class="m_-2580811094440566248m_7705193659913012554gmail_msg"><div class="m_-2580811094440566248m_7705193659913012554gmail_msg">On Dec 2, 2016, at 2:21 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" class="m_-2580811094440566248m_7705193659913012554gmail_msg" target="_blank">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class="m_-2580811094440566248m_7705193659913012554m_1084301622453376980m_-6858905872626469706Apple-interchange-newline m_-2580811094440566248m_7705193659913012554gmail_msg"><div class="m_-2580811094440566248m_7705193659913012554gmail_msg">I&#39;m not sure why that last scenario couldn&#39;t be accommodated by submodules. Why wouldn&#39;t you put those two specific submodules in the same parent submodule?<br class="m_-2580811094440566248m_7705193659913012554gmail_msg"></div></blockquote><div class="m_-2580811094440566248m_7705193659913012554gmail_msg"><br class="m_-2580811094440566248m_7705193659913012554gmail_msg"></div></div></div><div style="word-wrap:break-word" class="m_-2580811094440566248m_7705193659913012554gmail_msg"><div class="m_-2580811094440566248m_7705193659913012554gmail_msg"><div class="m_-2580811094440566248m_7705193659913012554gmail_msg">Why even have private and fileprivate? Why not just make everything internal?  Same reason…</div></div></div><div style="word-wrap:break-word" class="m_-2580811094440566248m_7705193659913012554gmail_msg"><div class="m_-2580811094440566248m_7705193659913012554gmail_msg"><div class="m_-2580811094440566248m_7705193659913012554gmail_msg"><br class="m_-2580811094440566248m_7705193659913012554gmail_msg"></div><div class="m_-2580811094440566248m_7705193659913012554gmail_msg"><br class="m_-2580811094440566248m_7705193659913012554gmail_msg"></div><br class="m_-2580811094440566248m_7705193659913012554gmail_msg"><blockquote type="cite" class="m_-2580811094440566248m_7705193659913012554gmail_msg"><div class="m_-2580811094440566248m_7705193659913012554gmail_msg"><div class="gmail_quote m_-2580811094440566248m_7705193659913012554gmail_msg"><div dir="ltr" class="m_-2580811094440566248m_7705193659913012554gmail_msg">On Fri, Dec 2, 2016 at 15:35 Jonathan Hull via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="m_-2580811094440566248m_7705193659913012554gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br class="m_-2580811094440566248m_7705193659913012554gmail_msg"></div><blockquote class="gmail_quote m_-2580811094440566248m_7705193659913012554gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="m_-2580811094440566248m_7705193659913012554gmail_msg">Assuming that this is true (I tend to agree), why do we need any extra syntax at all?  Couldn’t we just make everything accessible to extensions?<div class="m_-2580811094440566248m_7705193659913012554gmail_msg"><br class="m_-2580811094440566248m_7705193659913012554gmail_msg"></div><div class="m_-2580811094440566248m_7705193659913012554gmail_msg">Alternatively, if we do want to hide some things from extensions by default (to prevent accidental use), I had a proposal a while back which had a very simple way to control what is shared. Basically, you could have a special import statement which allows you to extend knowledge/access of the hidden parts to another file (you were also able to limit the range of this ability if needed).</div><div class="m_-2580811094440566248m_7705193659913012554gmail_msg"><br class="m_-2580811094440566248m_7705193659913012554gmail_msg"></div><div class="m_-2580811094440566248m_7705193659913012554gmail_msg">Most of the feedback at the time seemed to want submodules instead, but I still think there will still eventually be a need for something like this. As others have mentioned, the current system is inflexible (especially to the common use cases), causing people to keep requesting additions… and forcing them to give wider access than they want to in the mean time.  Even if we have sub-modules, someone will want to share with a specific other sub-module, but not make things public.</div></div><div style="word-wrap:break-word" class="m_-2580811094440566248m_7705193659913012554gmail_msg"><div class="m_-2580811094440566248m_7705193659913012554gmail_msg"><div class="m_-2580811094440566248m_7705193659913012554gmail_msg"><br class="m_-2580811094440566248m_7705193659913012554gmail_msg"></div><div class="m_-2580811094440566248m_7705193659913012554gmail_msg"><br class="m_-2580811094440566248m_7705193659913012554gmail_msg"></div><div class="m_-2580811094440566248m_7705193659913012554gmail_msg"><br class="m_-2580811094440566248m_7705193659913012554gmail_msg"><div class="m_-2580811094440566248m_7705193659913012554gmail_msg"><blockquote type="cite" class="m_-2580811094440566248m_7705193659913012554gmail_msg"><div class="m_-2580811094440566248m_7705193659913012554gmail_msg">On Dec 1, 2016, at 1:31 AM, Tino Heth via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="m_-2580811094440566248m_7705193659913012554gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_-2580811094440566248m_7705193659913012554gmail_msg m_-2580811094440566248m_7705193659913012554m_1084301622453376980m_-6858905872626469706m_-3605580025006761637Apple-interchange-newline"><div class="m_-2580811094440566248m_7705193659913012554gmail_msg"><div style="word-wrap:break-word" class="m_-2580811094440566248m_7705193659913012554gmail_msg"><div class="m_-2580811094440566248m_7705193659913012554gmail_msg"><br class="m_-2580811094440566248m_7705193659913012554gmail_msg"><blockquote type="cite" class="m_-2580811094440566248m_7705193659913012554gmail_msg"><div class="m_-2580811094440566248m_7705193659913012554gmail_msg"><div 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" class="m_-2580811094440566248m_7705193659913012554gmail_msg">It also means that anybody who want to access your private var will just have to write an extension to expose it.</div></div></blockquote></div>imho this is wrong thinking:<div class="m_-2580811094440566248m_7705193659913012554gmail_msg">Access control is no tool to offer real &quot;protection&quot; — it can&#39;t stop someone who wants to break a system.</div><div class="m_-2580811094440566248m_7705193659913012554gmail_msg">Especially in the world of open source, it is merely an advice from the author not to do certain things.</div></div>______________________________<wbr>_________________<br class="m_-2580811094440566248m_7705193659913012554gmail_msg">swift-evolution mailing list<br class="m_-2580811094440566248m_7705193659913012554gmail_msg"><a href="mailto:swift-evolution@swift.org" class="m_-2580811094440566248m_7705193659913012554gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="m_-2580811094440566248m_7705193659913012554gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="m_-2580811094440566248m_7705193659913012554gmail_msg" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-evolution</a><br class="m_-2580811094440566248m_7705193659913012554gmail_msg"></div></blockquote></div><br class="m_-2580811094440566248m_7705193659913012554gmail_msg"></div></div></div>______________________________<wbr>_________________<br class="m_-2580811094440566248m_7705193659913012554gmail_msg">
swift-evolution mailing list<br class="m_-2580811094440566248m_7705193659913012554gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="m_-2580811094440566248m_7705193659913012554gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="m_-2580811094440566248m_7705193659913012554gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="m_-2580811094440566248m_7705193659913012554gmail_msg" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-evolution</a><br class="m_-2580811094440566248m_7705193659913012554gmail_msg">
</blockquote></div>
</div></blockquote></div></div></blockquote></div>
______________________________<wbr>_________________<br class="m_-2580811094440566248m_7705193659913012554gmail_msg">
swift-evolution mailing list<br class="m_-2580811094440566248m_7705193659913012554gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="m_-2580811094440566248m_7705193659913012554gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="m_-2580811094440566248m_7705193659913012554gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="m_-2580811094440566248m_7705193659913012554gmail_msg" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-evolution</a><br class="m_-2580811094440566248m_7705193659913012554gmail_msg">
</blockquote></div>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div>