<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=""><div class="">I submitted a proposal with TJ a while ago that tried to address this comprehensively because the trouble is if you just want submodules you have to define how our current penta-scheme of access control interacts with each level or do away with a few of them to make some simplifying assumptions. It also raises an ambiguity with qualified imports that has to be worked out.</div><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 30, 2017, at 9:00 AM, 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="">If I remember correctly it has been said that we don't need namespaces in favor of submodules, which schould solve these issues.<br class=""> <br class=""><div class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px" class="">-- <br class="">Adrian Zubarev<br class="">Sent with Airmail</div></div><p class="gmail_quote" style="">Am 30. Januar 2017 um 14:55:31, Tuur Anton via swift-evolution (<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>) schrieb:</p> <blockquote type="cite" class="gmail_quote"><span class=""><div class=""><div class=""></div><div class="">
<title class=""></title>
<div class="">The lack of namespaces is making people create all kinds of
"design patterns".<br class=""></div>
<div class=""><br class=""></div>
<div class="">struct API {</div>
<div class=""> static let endpoint = "<a href="http://example.com/api" target="_blank" rel="noopener noreferrer" class="">http://example.com/api</a>"</div>
<div class="">}</div>
<div class=""><br class=""></div>
<div class="">Here is an "improvement" to the above "design pattern" to
prevent instantiating API:</div>
<div class=""><br class=""></div>
<div class="">struct API {</div>
<div class=""> private init() {}</div>
<div class=""> static let endpoint = "<a href="http://example.com/api" target="_blank" rel="noopener noreferrer" class="">http://example.com/api</a>"</div>
<div class="">}</div>
<div class=""><br class=""></div>
<div class="">Finally, here is another "improvement" that uses enum instead
of struct to avoid having to write the private initializer:</div>
<div class=""><br class=""></div>
<div class="">enum API {</div>
<div class=""> static let endpoint = "<a href="http://example.com/api" target="_blank" rel="noopener noreferrer" class="">http://example.com/api</a>"</div>
<div class="">}</div>
<div class=""><br class=""></div>
<div class="">I doubt any of you find this beautiful. Yet these "design
patterns" (just hacks IMO) are spreading like the plague because of
the lack of namespaces.</div>
<div class=""><br class=""></div>
<div class="">What do you think?</div>
<div class=""><br class=""></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></div></span></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>