<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><blockquote type="cite" class=""><div class="">On Apr 7, 2017, at 8:37 AM, Jonathan Hull via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I think that is why he is saying (and I agree), that ‘fileprivate’ needs to be the soft-default. That way private will mean something.</div></div></blockquote><div><br class=""></div>Keywords aren't completely arbitrary. Programmers will always reach for 'private' first, both from familiarity with other languages and because of the obvious contrast with 'public'. You can teach them not to do that, but that then becomes something they have to specifically learn instead of something that comes intuitively.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">His point that this gets rid of the primary use-case of ‘private’ (over ‘fileprivate’) is also extremely relevant.</div></div></div></blockquote><div><br class=""></div><div>That depends very much on what you put in a single file. If you generally just put a single type and its extensions in a file, then yes, 'private' and 'fileprivate' are essentially the same, other than for nested types. If you put other code in the same file, 'private' remains meaningfully stronger than 'fileprivate'. In both cases, 'private' is reinforced as a default choice; but you do lose that ability to prevent extensions from directly accessing the stored properties of a type, which I agree is a significant loss.</div><div><br class=""></div><div>John.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><br class=""></div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Apr 7, 2017, at 4:51 AM, Gwendal Roué via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">Le 7 avr. 2017 à 13:44, Matthew Johnson via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 14px; 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; -webkit-text-stroke-width: 0px;" class="">No. I believe it makes the language worse, not better. It doesn’t address the real problems with access control. The largest problem is the inability to form scopes between files and the entire module. The problem with `fileprivate` and `private` is a naming problem, not a semantics problem.</div></div></blockquote><br class=""></div><div class="">This is the base of your argument, and I think it is wrong, considering that code is a living matter, not a static one.</div><div class=""><br class=""></div><div class="">Too many properties initially declared as `private` have to be declared `fileprivate` later, because the code is evolving. And this change is usually performed just to tame a compiler error.</div><div class=""><br class=""></div><div class="">This is why the current private/fileprivate situation is actually a semantics problem. Private is not stable enough to mean anything.</div><div class=""><br class=""></div><div class="">Gwendal Roué</div><div class=""><br class=""></div></div>_______________________________________________<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" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></div></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>