If you make a dynamic framework called APIFramework<br>And add a public class called URL_ME<br><br>You can instantiate it with APIFramework.URL_ME() from your project.<br> <br><br>I haven&#39;t tried to see if this would work with global variables but I assume it would.<br><div class="gmail_quote"><div dir="ltr">On Mon, Jan 30, 2017 at 3:09 PM Robert Widmann via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg">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></div><div style="word-wrap:break-word" class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Jan 30, 2017, at 9:00 AM, Adrian Zubarev via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_6343523174815723Apple-interchange-newline gmail_msg"><div class="gmail_msg"><div class="gmail_msg">If I remember correctly it has been said that we don&#39;t need namespaces in favor of submodules, which schould solve these issues.<br class="gmail_msg"> <br class="gmail_msg"><div class="m_6343523174815723bloop_sign gmail_msg"><div style="font-family:helvetica,arial;font-size:13px" class="gmail_msg">-- <br class="gmail_msg">Adrian Zubarev<br class="gmail_msg">Sent with Airmail</div></div><p class="gmail_quote gmail_msg">Am 30. Januar 2017 um 14:55:31, Tuur Anton via swift-evolution (<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>) schrieb:</p> <blockquote type="cite" class="gmail_quote gmail_msg"><span class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"></div><div class="gmail_msg">






<div class="gmail_msg">The lack of namespaces is making people create all kinds of
&quot;design patterns&quot;.<br class="gmail_msg"></div>
<div class="gmail_msg"><br class="gmail_msg"></div>
<div class="gmail_msg">struct API {</div>
<div class="gmail_msg">    static let endpoint = &quot;<a href="http://example.com/api" rel="noopener noreferrer" class="gmail_msg" target="_blank">http://example.com/api</a>&quot;</div>
<div class="gmail_msg">}</div>
<div class="gmail_msg"><br class="gmail_msg"></div>
<div class="gmail_msg">Here is an &quot;improvement&quot; to the above &quot;design pattern&quot; to
prevent instantiating API:</div>
<div class="gmail_msg"><br class="gmail_msg"></div>
<div class="gmail_msg">struct API {</div>
<div class="gmail_msg">    private init() {}</div>
<div class="gmail_msg">    static let endpoint = &quot;<a href="http://example.com/api" rel="noopener noreferrer" class="gmail_msg" target="_blank">http://example.com/api</a>&quot;</div>
<div class="gmail_msg">}</div>
<div class="gmail_msg"><br class="gmail_msg"></div>
<div class="gmail_msg">Finally, here is another &quot;improvement&quot; that uses enum instead
of struct to avoid having to write the private initializer:</div>
<div class="gmail_msg"><br class="gmail_msg"></div>
<div class="gmail_msg">enum API {</div>
<div class="gmail_msg">    static let endpoint = &quot;<a href="http://example.com/api" rel="noopener noreferrer" class="gmail_msg" target="_blank">http://example.com/api</a>&quot;</div>
<div class="gmail_msg">}</div>
<div class="gmail_msg"><br class="gmail_msg"></div>
<div class="gmail_msg">I doubt any of you find this beautiful. Yet these &quot;design
patterns&quot; (just hacks IMO) are spreading like the plague because of
the lack of namespaces.</div>
<div class="gmail_msg"><br class="gmail_msg"></div>
<div class="gmail_msg">What do you think?</div>
<div class="gmail_msg"><br class="gmail_msg"></div>


_______________________________________________<br class="gmail_msg">swift-evolution mailing list<br class="gmail_msg"><a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg"></div></div></span></blockquote></div>_______________________________________________<br class="gmail_msg">swift-evolution mailing list<br class="gmail_msg"><a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg"></div></blockquote></div><br class="gmail_msg"></div>_______________________________________________<br class="gmail_msg">
swift-evolution mailing list<br class="gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
</blockquote></div>