<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=""><div class="">Hi Jeremy and Nevin</div><div class=""><br class=""></div><div class="">Sorry for the delay. quite busy.</div><div class=""><br class=""></div><div class="">As described, the point of my message is that I would like to have the inner members of a class</div><div class="">as default private, that is, not visible in the outer scope and to reveal members (entities)</div><div class="">of the class to the outside world *explicitly* by specifying an access qualifier like</div><div class="">“public” or “internal”, so exactly the other way round as it is now.&nbsp;</div><div class="">In the current situation I have to precede all declarations which I don’t want to reveal</div><div class="">with “private”. Usually most entities of a class should not be visible outside of it.&nbsp;</div><div class="">To prevent source breaking one could precede the class definition with a keyword, telling</div><div class="">Swift that all members of a class are private by default like so</div><div class=""><br class=""></div><div class="" style="margin: 0px; font-size: 17px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(186, 45, 162);">closedscope</span><span class="" style="font-variant-ligatures: no-common-ligatures;">&nbsp;</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(186, 45, 162);">class</span><span class="" style="font-variant-ligatures: no-common-ligatures;">&nbsp;TG3DGauge:&nbsp;</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">SCNNode</span></div><div class="" style="margin: 0px; font-size: 17px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;">{</span></div><div class="" style="margin: 0px; font-size: 17px; line-height: normal; font-family: Menlo; min-height: 20px;"><span class="" style="font-variant-ligatures: no-common-ligatures;">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></div><div class="" style="margin: 0px; font-size: 17px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;">&nbsp; &nbsp;&nbsp;</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(186, 45, 162);">var</span><span class="" style="font-variant-ligatures: no-common-ligatures;">&nbsp;needles = [</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">SCNNode</span><span class="" style="font-variant-ligatures: no-common-ligatures;">]() &nbsp;</span><span class="" style="color: rgb(0, 132, 0);">// is now private by default</span></div><div class="" style="margin: 0px; font-size: 17px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;">&nbsp; &nbsp;&nbsp;</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(186, 45, 162);">var</span><span class="" style="font-variant-ligatures: no-common-ligatures;">&nbsp;fmtStr =&nbsp;</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">“" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="" style="color: rgb(0, 132, 0);">// is now private by default</span></div><div style="margin: 0px; font-size: 17px; line-height: normal; font-family: Menlo; min-height: 20px;" class="">&nbsp; &nbsp;&nbsp;<br class="webkit-block-placeholder"></div><div class=""><span class="" style="font-family: Menlo; font-size: 17px; font-variant-ligatures: no-common-ligatures;">&nbsp; &nbsp;&nbsp;</span><span class="" style="font-family: Menlo; font-size: 17px; font-variant-ligatures: no-common-ligatures; color: rgb(186, 45, 162);">public var</span><span class="" style="font-family: Menlo; font-size: 17px; font-variant-ligatures: no-common-ligatures;">&nbsp;value:&nbsp;</span><span class="" style="font-family: Menlo; font-size: 17px; font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">CGFloat</span><span class="" style="font-family: Menlo; font-size: 17px; font-variant-ligatures: no-common-ligatures;">&nbsp;=&nbsp;</span><span class="" style="font-family: Menlo; font-size: 17px; font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">0&nbsp;</span><font color="#008400" face="Menlo" class=""><span class="" style="font-size: 17px;">// Public!! visible outside class also for&nbsp;“fileprivate" or&nbsp;“internal” &nbsp;</span></font></div><div class=""><br class=""></div><div class="">(as written before) &nbsp;</div><div class=""><br class=""></div><div class="">If this “closedscope” qualifier is not used things are exactly as it is now.</div><div class=""><br class=""></div><div class="">The “fileprivate” qualifier doen’t need to go so no source breaking here.</div><div class="">I simply stated that I am not really a fan of it.</div><div class=""><br class=""></div><div class="">Kind Regards</div><div class="">Ted</div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On 27 Sep 2016, at 10:34, Jeremy Pereira &lt;<a href="mailto:jeremy.j.pereira@googlemail.com" class="">jeremy.j.pereira@googlemail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><br class=""><blockquote type="cite" class="">On 26 Sep 2016, at 20:58, Ted F.A. van Gaalen via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class="">Hello! Hope you are all OK! <br class=""><br class=""><br class="">As far as I can see without binoculars, the “fileprivate” acces modifier<br class="">could be dropped, were it not for source compatibility reasons... <br class=""><br class="">Unless I am missing something: <br class=""></blockquote><br class="">Yes you are missing something. I, for example have a few cases where it is useful. On the other hand, I was against the change in the meaning of private but, I have to concede that the new meaning is useful. <br class=""><br class="">As for dropping file private, why? You don’t have to use it if you don’t want to, so it’s not hurting you. On the other hand, I can use it when I deem it to be the right thing to do. <br class=""><br class=""><br class=""><blockquote type="cite" class="">I don’t want the inner elements<br class="">of a class (or struct ?) to be visible in outer scope!<br class="">This is the default case in most OOP languages. <br class=""></blockquote><br class="">The default in Java is package scope. I’m not sure what the default in C++ is, but it’s not private, ditto Javascript. So while that might not be most OOP languages, it probably covers most OOP programs.<br class=""><br class="">While I think private by default has merit, we are where we are.<br class=""><br class=""><br class=""></div></div></blockquote></div><br class=""></body></html>