<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=""><div class="">It is hard to argue with that :)</div><div class=""><br class=""></div><div class="">I think the problem with more or less all new access level modifiers is that while there are legit uses for folderprivate, typeprivate and what else have been proposed recently, all of them also allow for some pretty no-legit anti-pattern uses as well.</div></div><div class=""><br class=""></div><div class="">I will go back to my long swift files and fileprivate now ;)</div><div class=""><br class=""></div><div class="">/Aron</div><br class=""><div><blockquote type="cite" class=""><div class="">On 8 Dec 2016, at 14.05, Adrian Zubarev 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=""><div class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; 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; background-color: rgb(254, 254, 254);"><p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">Overkill or not, grouping files into a folder/group +<span class="Apple-converted-space"> </span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">folderprivate</code><span class="Apple-converted-space"> </span>smells exactly like a submodule to me. ;)<span class="Apple-converted-space"> </span></p><hr style="height: 0.2em; border: 0px; color: rgb(204, 204, 204); background-color: rgb(204, 204, 204); display: inherit;" class=""><p style="margin: 15px 0px;" class="">The only thing I’m repeating over and over is that we should fix that<span class="Apple-converted-space"> </span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">open</code><span class="Apple-converted-space"> </span>mess and allow protocols to have the same<span class="Apple-converted-space"> </span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">open/public</code><span class="Apple-converted-space"> </span>access level as classes have.<span class="Apple-converted-space"> </span></p><ul style="margin: 15px 0px;" class=""><li style="margin: 15px 0px; -webkit-margin-before: 0px;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">open protocol</code><span class="Apple-converted-space"> </span>from module A is allowed to be conformed to from module B</li><li style="margin: 15px 0px;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">public protocol</code><span class="Apple-converted-space"> </span>from module A can only be used as an interface in module B</li></ul><div style="margin: 15px 0px;" class=""><br class="webkit-block-placeholder"></div></div><div class="bloop_original_html" style="font-family: Helvetica, Arial; font-size: 13px; 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; background-color: rgb(254, 254, 254);"><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class=""><br class=""></div><br class=""><div id="bloop_sign_1481201966565935104" class="bloop_sign"><div style="font-family: helvetica, arial; font-size: 13px;" class="">-- <br class="">Adrian Zubarev<br class="">Sent with Airmail</div></div><br class=""><p class="airmail_on" style="margin: 15px 0px;">Am 8. Dezember 2016 um 13:52:27, Aron Lindberg (<a href="mailto:aronl@me.com" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">aronl@me.com</a>) schrieb:</p><blockquote type="cite" class="clean_bq" style="margin: 15px 0px;"><span style="margin-top: 0px; margin-bottom: 0px;" class=""><div class=""><div class=""></div><div class="">I realise the general opinion here seems to be that we don't want any more changes to the access modifiers and I can understand why, but please take a look at the use case below:<span class="Apple-converted-space"> </span><br class=""><br class="">"fileprivate" is needed for certain things like Equatable since the equatable function might need to know about private properties in a class. Lets say I have two structs:<span class="Apple-converted-space"> </span><br class=""><br class="">struct A {<span class="Apple-converted-space"> </span><br class="">...<span class="Apple-converted-space"> </span><br class="">}<span class="Apple-converted-space"> </span><br class=""><br class="">struct B {<span class="Apple-converted-space"> </span><br class="">...<span class="Apple-converted-space"> </span><br class="">}<span class="Apple-converted-space"> </span><br class=""><br class="">Both are rather big so I declare each in a separate file (File A, File B), but I need to implement an equals function between these two structs that need access to private properties in both structs. This leaves me with two options:<span class="Apple-converted-space"> </span><br class=""><br class="">a) Move the two structs into one file and use fileprivate and implement the equals function here. The result is one long messy file.<span class="Apple-converted-space"> </span><br class="">b) Move the two files into a separate module and use "internal" for the variables I need acces to. This feels like overkill and struct A/B might have dependencies that make this inconvenient.<span class="Apple-converted-space"> </span><br class=""><br class="">Am I missing a more optimal solution here?<span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class=""><br class="">My point is there are legit use cases of fileprivate there might lead to one really big file, with several classes. Having a folderprivate access level would be one possible solution to this.<span class="Apple-converted-space"> </span><br class=""><br class="">> On 8 Dec 2016, at 13.22, Rien via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">> Will discprivate be next? and then systemprivate? </facetious><span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">> -1<span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">> Regards,<span class="Apple-converted-space"> </span><br class="">> Rien<span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">> Site: <a href="http://balancingrock.nl" class="">http://balancingrock.nl</a><span class="Apple-converted-space"> </span><br class="">> Blog: <a href="http://swiftrien.blogspot.com" class="">http://swiftrien.blogspot.com</a><span class="Apple-converted-space"> </span><br class="">> Github: <a href="http://github.com/Swiftrien" class="">http://github.com/Swiftrien</a><span class="Apple-converted-space"> </span><br class="">> Project: <a href="http://swiftfire.nl" class="">http://swiftfire.nl</a><span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>> On 08 Dec 2016, at 12:27, Adrian Zubarev via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<span class="Apple-converted-space"> </span><br class="">>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>> Personal statement: –1<span class="Apple-converted-space"> </span><br class="">>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>> --<span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>> Adrian Zubarev<span class="Apple-converted-space"> </span><br class="">>> Sent with Airmail<span class="Apple-converted-space"> </span><br class="">>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>> Am 8. Dezember 2016 um 12:26:17, Aron Lindberg (<a href="mailto:aronl@me.com" class="">aronl@me.com</a>) schrieb:<span class="Apple-converted-space"> </span><br class="">>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>> I think this is a great idea!<span class="Apple-converted-space"> </span><br class="">>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>> I would prefer calling it folderprivate tho.<span class="Apple-converted-space"> </span><br class="">>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>> On 8 Dec 2016, at 08.29, Adrian Zubarev via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<span class="Apple-converted-space"> </span><br class="">>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>> Whoops I meant directoryprivate not dictionaryprivate. I’m probably still sleepy.<span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>> --<span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>> Adrian Zubarev<span class="Apple-converted-space"> </span><br class="">>>>> Sent with Airmail<span class="Apple-converted-space"> </span><br class="">>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>> Am 8. Dezember 2016 um 08:18:24, Adrian Zubarev (<a href="mailto:adrian.zubarev@devandartist.com" class="">adrian.zubarev@devandartist.com</a>) schrieb:<span class="Apple-converted-space"> </span><br class="">>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>> You haven’t seen this in the list because no one requested dictionaryprivate yet. :D<span class="Apple-converted-space"> </span><br class="">>>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>> @core-team: See what you have done with >>file<<private thing. typerprivate, typepublic all these requests for new access modifiers.<span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>> Instead of just going with<span class="Apple-converted-space"> </span><br class="">>>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>> private<span class="Apple-converted-space"> </span><br class="">>>>>> private(file)<span class="Apple-converted-space"> </span><br class="">>>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>> // for new one<span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>> private(type)<span class="Apple-converted-space"> </span><br class="">>>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>> I know there would be some people that would forget about (file/type) and write only private everywhere, which is probably the main reason why we have fileprivate now.<span class="Apple-converted-space"> </span><br class="">>>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>> Anyways let’s be a little more constructive here.<span class="Apple-converted-space"> </span><br class="">>>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>> Hi Jim, regarding your request, it feels like this is something that falls into the topic of submodules. :) Correct me if I’m wrong here.<span class="Apple-converted-space"> </span><br class="">>>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>> --<span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>> Adrian Zubarev<span class="Apple-converted-space"> </span><br class="">>>>>> Sent with Airmail<span class="Apple-converted-space"> </span><br class="">>>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>> Am 8. Dezember 2016 um 07:50:07, Jim Malak via swift-evolution (<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>) schrieb:<span class="Apple-converted-space"> </span><br class="">>>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>>> My apologies up front if I am going about this incorrectly. I have been exploring extensions in Swift 3 both as a part of protocol-oriented programming and as a way to encapsulate related code to improve readability and maintainablity of otherwise more complex classes I have designed. I am able to encapsulate methods and calculated properties in extensions and restrict their use to the object type I am extending as long as everything is in one file via fileprivate.<span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>>> I would like to be able to have my class or structure file in a directory that contains my associated extensions (also in separate files) and be able to restrict the access of appropriate properties and methods to that common directory. This would allow the same level encapsulation as fileprivate with the benifit of being able to organize code into sepereate files based on function.<span class="Apple-converted-space"> </span><br class="">>>>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>>> I did not see this in the commonly rejected list but am unsure if this is something that is out of scope for 4.0. Is this something I can write up a proposal for? Is there some other approach that I missed that I should be using instead?<span class="Apple-converted-space"> </span><br class="">>>>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>>> Kind regards,<span class="Apple-converted-space"> </span><br class="">>>>>>> Jim Malak<span class="Apple-converted-space"> </span><br class="">>>>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>>>> _______________________________________________<span class="Apple-converted-space"> </span><br class="">>>>>>> swift-evolution mailing list<span class="Apple-converted-space"> </span><br class="">>>>>>> <a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><span class="Apple-converted-space"> </span><br class="">>>>>>> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><span class="Apple-converted-space"> </span><br class="">>>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>>>> _______________________________________________<span class="Apple-converted-space"> </span><br class="">>>>> swift-evolution mailing list<span class="Apple-converted-space"> </span><br class="">>>>> <a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><span class="Apple-converted-space"> </span><br class="">>>>> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><span class="Apple-converted-space"> </span><br class="">>>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">>> _______________________________________________<span class="Apple-converted-space"> </span><br class="">>> swift-evolution mailing list<span class="Apple-converted-space"> </span><br class="">>> <a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><span class="Apple-converted-space"> </span><br class="">>> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class="">> _______________________________________________<span class="Apple-converted-space"> </span><br class="">> swift-evolution mailing list<span class="Apple-converted-space"> </span><br class="">> <a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><span class="Apple-converted-space"> </span><br class="">> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><span class="Apple-converted-space"> </span><br class=""><br class=""></div></div></span></blockquote></div><div class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; 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; background-color: rgb(254, 254, 254);"><div style="margin: 15px 0px; -webkit-margin-before: 0px;" class=""><br class="webkit-block-placeholder"></div></div><span style="font-family: Helvetica, Arial; font-size: 13px; 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; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica, Arial; font-size: 13px; 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; background-color: rgb(254, 254, 254);" class=""><span style="font-family: Helvetica, Arial; font-size: 13px; 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; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: Helvetica, Arial; font-size: 13px; 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; background-color: rgb(254, 254, 254);" class=""><span style="font-family: Helvetica, Arial; font-size: 13px; 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; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a></span><br style="font-family: Helvetica, Arial; font-size: 13px; 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; background-color: rgb(254, 254, 254);" class=""><span style="font-family: Helvetica, Arial; font-size: 13px; 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; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br style="font-family: Helvetica, Arial; font-size: 13px; 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; background-color: rgb(254, 254, 254);" class=""></div></blockquote></div><br class=""></body></html>