<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><blockquote type="cite" class="">On Mar 23, 2017, at 8:35 PM, Matthew Johnson via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""></blockquote><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">On Mar 23, 2017, at 8:27 PM, Drew Crawford <<a href="mailto:drew@sealedabstract.com" class="">drew@sealedabstract.com</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><div class=""><div class=""><br class=""></div><div class=""><div class=""><br class=""><br class="">Sent from my iPhone</div>On Mar 23, 2017, at 6:41 PM, David Hart <<a href="mailto:david@hartbit.com" class="">david@hartbit.com</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class="">I have difficulties imagining a submodule proposal that could allow us to eliminate fileprivate. Care to give an example?</div></blockquote><br class=""><div class="">The obvious example would be Rust. Rust has exactly two visibilities, and merely one keyword. By default, members are "private" which is visible inside the module (so, like Swift's internal). The "public" keyword is similar to Swift. </div><div class=""><br class=""></div><div class="">The reason this works is that unlike in Swift where a module is something like a library or framework (Rust calls those "crates"), in Rust modules in are (explicitly) lexically scoped; a "mod myscope {}" module can be created for the portion of the file for which the member should be visible and it won't be visible outside that scope. Likewise, "fileprivate" can be achieved by enclosing the file in a "mod MyFile {}". And like all lexical scopes, they can be recursively nested to arbitrary depth to achieve any number of visibility behaviors (e.g., declare a module for the first half of two files) that would require complex new keywords to achieve in Swift.<span class="Apple-converted-space"> </span><span style="background-color: rgba(255, 255, 255, 0);" class="">Finally there are some shortcut features like the ability to infer a module structure from the file system. </span></div></div></blockquote><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">This is a good example of what I meant. There is an extremely broad range of possible designs for submodules. Some of them, such as this example, would make it relatively easy to get by without fileprivate. There are also many other possible designs that would not. </span><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">We do not have any idea where Swift will end up yet. It's not reasonable to make any assumptions about what use cases the eventual design might or might not address.</div></div></blockquote></div><br class=""><div class="">Then why not leave private and fileprivate alone until we do?</div><div class=""><br class=""></div><div class="">Charles</div><div class=""><br class=""></div></body></html>