<div dir="ltr">Hmm, ok, so I wasn&#39;t too far off. I guess this still is along the lines of the Obj-C way of namespacing. Sorta.. I&#39;m going to look into this more on the swift package project and in the mean time, I&#39;ll use the relevant project name prefix in the module name. Thanks!</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 1, 2016 at 5:53 PM, Erica Sadun <span dir="ltr">&lt;<a href="mailto:erica@ericasadun.com" target="_blank">erica@ericasadun.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>This is a good reason why package names should be clear and specific, avoiding common phrases and terms that will overlap. </div><div>A proven way to avoid such issues is to namespace your packages in some way, e.g. prefer <font face="Menlo">SadunStringUtilities</font> vs <font face="Menlo">SwiftString</font>.</div><div><br></div><div>At this time there is no built-in way that I know of how to deal with module name collisions. So let me speculate about what</div><div>a solution might look like. (Skip to the next message if this doesn&#39;t interest.) Having a reverse domain name as</div><div>part of the Package declaration syntax maybe could address part of the issue, for example:</div><div><br></div><div><font face="Menlo">import PackageDescription</font></div><div><font face="Menlo"><br></font></div><div><font face="Menlo">let package = Package(</font></div><div><font face="Menlo">    name: &quot;SwiftString&quot;</font></div><div><font face="Menlo">    origin: &quot;com.sadun&quot;</font></div><div><font face="Menlo">)</font></div><div><br></div><div>and in the case of name conflicts use:</div><div><br></div><div><font face="Menlo">import com.sadun.SwiftString</font></div><div><font face="Menlo">import com.LeeJason.SwiftString</font></div><div><br></div><div>with all the annoying resolution that might involve in disambiguating symbols.  I could also </div><div>see some kind of package alias being needed if this problem got too bad, e.g.</div><div><br></div><div><font face="Menlo">packagealias Sadun = com.sadun.SwiftString</font></div><div><font face="Menlo">packagealias LeeJ = com.lLeeJason.SwiftString</font></div><div><font face="Menlo"><br></font></div><div><font face="Menlo">let x = LeeJ.countStringItems(someString)</font></div><div><br></div><div>but I don&#39;t know how Swift would disambiguate, for example, two packages that both created</div><div> public extensions on String both being imported into the same file, and both offering conflicting, say, properties.</div><div><br></div><div>-- Erica</div><div><br></div><br><div><blockquote type="cite"><div><div class="h5"><div>On Feb 1, 2016, at 6:41 PM, Jason Lee via swift-users &lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt; wrote:</div><br></div></div><div><div><div><div class="h5">Today I introduced a dependency on another project&#39;s package with brought over a module name that conflicted with one he modules in my project.<br><br>Currently my project has multiple modules (and executables) in the package and everything is working well for me. However, when I got this conflict today, I was thinking this will be a problem going forward. I&#39;m sure it&#39;s been solved already by the package manager team, but I haven&#39;t figured out how to do this from the docs yet.<br><br>An example:<br>Package &#39;A&#39; has a module named &#39;Base&#39;<br>My package also has a module named &#39;Base&#39;<br><br>When I build, I get a circular ref error now. One way I was thinking I cld fix this on my end is to prefix all my module names with my package name (seems redundant, of course). Something like &#39;Base&#39; becomes &#39;MyAppBase&#39;. And my imports could look like so:<br><br>import Foundation<br>import Base<br>import MyAppBase<br><br>Any thoughts on this? Thx.<br><br>- jason<br><br>Sent from my iPhone<br></div></div>_______________________________________________<br>swift-users mailing list<br><a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-users" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br></div></div></blockquote></div><br></div></blockquote></div><br></div>