<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="">I can’t find a reply that seemed to cover this so I’d like to ask again, but why just you a parameter on private for all hidden visibility types? i.e-</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>public<span class="Apple-tab-span" style="white-space:pre">                        </span>(current meaning of public)</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>private (module)<span class="Apple-tab-span" style="white-space:pre">        </span>(current meaning of internal)</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>private (type)<span class="Apple-tab-span" style="white-space:pre">                </span>(new scoped visibility, could be named scoped instead but I prefer type personally)</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>private (file)<span class="Apple-tab-span" style="white-space:pre">                </span>(current meaning of private)</div><div class=""><br class=""></div><div class="">This eliminates the need for an additional keyword, and actually trims internal as well, plus all visibility is then either public (externally accessible) or private (internally accessible with some degree of restriction). When used without a parameter private on its own would now default to private (type).</div><div class=""><br class=""></div><div class="">The ability to place a visibility restriction only upon a getter/setter would be handled as a parameter value, for example:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>private (file: set)<span class="Apple-tab-span" style="white-space:pre">                        </span>(value can only be set within this file)</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>private (type: get, file: set)<span class="Apple-tab-span" style="white-space: pre;">        </span>(value is accessible within type, sub-types and extensions, but can only be set within this file)</div><div class=""><br class=""></div><div class="">I think it’s a very neat way to do things, and I think that for most cases private (type), the new default for private, is sufficient for a lot of use-cases. More importantly it eliminates the need for new keywords, actually trims one (we only need two for visibility not four) and also eliminates the need to find good single-word keywords that make sense on their own, since all limited types are explicitly grouped as private which should make it absolutely clear.</div><br class=""><div><blockquote type="cite" class=""><div class="">On 26 Mar 2016, at 07:14, Cheyo Ximenez 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=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class=""></div><div class="">I agree with Ross. Swift already redefined the common access modifiers meanings.&nbsp;</div><div class="">Why not use the word 'protected' to mean 'local'?</div><div class=""><br class=""></div><div class="">public</div><div class="">internal</div><div class="">private</div><div class="">protected // Java got it wrong. :) This is "protected" against extensions. &nbsp;</div><div class=""><br class="">On Mar 25, 2016, at 6:57 PM, Ross O'Brien via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">The specific meaning of 'public' and 'private' in programming languages refers to type-based symbol visibility. I'm thinking of C++, C#, Java and Objective C; their 'public' is Swift's 'internal'. They have no equivalent to Swift's 'public'. Swift has no equivalent to their 'private'.<div class=""><br class=""></div><div class="">Possibly my familiarity with other languages isn't broad enough, but this is why I haven't understood the idea that Swift's use of 'private' is "right" or "obvious". You learn Swift's meanings of these terms by coding in Swift, you don't learn these meanings anywhere else first.</div><div class=""><br class=""></div><div class="">To use a hopefully recognised example: an American who wants 'chips' wants what a Brit calls crisps; a Brit who wants chips wants what an American calls french fries. Which meaning of 'chips' is more intuitive? Answer: the one you grew up with.<br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sat, Mar 26, 2016 at 1:10 AM, Brent Royal-Gordon via swift-evolution <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=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">&gt; all of these names (public, internal, private, local) have specific meaning in the context of computer languages.<br class="">
<br class="">
</span>Yes, `local` has a meaning, but that meaning is generally *not* that it's an access level. It usually has something to do with declaring variables inside a function.<br class="">
<br class="">
For instance, Perl uses it to back up and restore a global variable. ML uses it to create a scope (roughly). Lua and Julia use it to declare lexical variables which are visible in enclosed scopes, which SE-0025's new access level is specifically *not* supposed to allow.<br class="">
<br class="">
I don't know of any language where `local` is used as an access level. If you're aware of an analogous use in another language, I'd be interested to see it. But the examples I've found if anything *undermine* the suggestion that `local` would be a good keyword choice.<br class="">
<div class="HOEnZb"><div class="h5"><br class="">
--<br class="">
Brent Royal-Gordon<br class="">
Architechies<br class="">
<br class="">
_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" 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><br class="">
</div></div></blockquote></div><br class=""></div>
</div></blockquote><blockquote type="cite" class=""><div class=""><span class="">_______________________________________________</span><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class=""></div></blockquote></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>