<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 23, 2016, at 12:59 AM, Pierre Monod-Broca <<a href="mailto:pierremonodbroca@gmail.com" class="">pierremonodbroca@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">My guess is most often one will want to import exactly what one is testing (Brent example) but I guess it would be very handy to do something like<br class=""><br class="">#if canImport(Foo)<br class=""> import Foo.Bar as FooBar<br class="">#endif<br class=""><br class="">In this case both form would be relevant.<br class=""></div></div></blockquote></div><br class=""><div class="">`import as ` does not fall under the scope of this proposal. I have been already discussing it</div><div class="">as part of an existing issue about package name conflicts on -build-dev, with the understanding</div><div class="">that this portion would have to be raised in -evolution. It's on my list for separate pitching.</div><div class="">An early draft is here: <a href="https://gist.github.com/erica/c6553a5f6f35e7462074" class="">https://gist.github.com/erica/c6553a5f6f35e7462074</a>, and the most</div><div class="">likely pathway would something like:</div><div class=""><br class=""></div><div class=""><div class="" style="font-family: Palatino-Roman;"><b class="">1. No change in the originating package description.</b></div><div class="" style="font-family: Palatino-Roman;"><br class=""></div><div class="" style="font-family: Palatino-Roman;"><div class="">import PackageDescription</div><div class=""><br class=""></div><div class=""><font class="">let package = Package(</font></div><div class=""><font class=""> name: "SwiftString",</font></div><div class="">)</div></div><div class="" style="font-family: Palatino-Roman;"><br class=""></div><div class="" style="font-family: Palatino-Roman;"><b class="">2. No change in the consuming package description.</b></div><div class="" style="font-family: Palatino-Roman;"><b class=""><br class=""></b></div><div class="" style="font-family: Palatino-Roman;"><div class="">import PackageDescription</div><div class="">let package = Package (</div><div class=""> name: "myutility",</div><div class=""> dependencies: [</div><div class=""> .Package(url: "<a href="https://github.com/erica/SwiftString.git" class="">https://github.com/erica/SwiftString.git</a>",</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span> majorVersion: 1),</div><div class=""> .Package(url: "<a href="https://github.com/nudas/SwiftString.git" class="">https://github.com/nudas/SwiftString.git</a>",</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span> majorVersion: 1),</div><div class=""> .Package(url: "<a href="http://github.com/erica/SomeStringOtherPackage.git" class="">http://github.com/erica/SomeStringOtherPackage.git</a>",</div><div class=""> majorVersion: 1), // just throwing some package in there</div><div class=""> ],</div><div class="">)</div><div class="" style="font-weight: bold;"><br class=""></div><div class=""><b class="">3. When unpacking, SwiftPM detects name overlap, automatically uses reverse domain name for unpacking</b></div><div class=""><b class=""><br class=""></b></div><div class="">In the current Swift PM: </div><div class=""> fatal: destination path '/home/erica/Work/test/Packages/SwiftString' already exists and is not an empty directory.</div><div class=""><br class=""></div><div class="">Instead:</div><div class="">* Would unpack into com.github.erica.SwiftString and com.github.nudas.SwiftString, automatically reversing the url</div><div class="">* From Swift files, since "import: SwiftString" allow import as erica.SwiftString, github.erica.SwiftString, or com.github.erica.SwiftString</div><div class=""><br class=""></div><div class=""><b class="">4. Propose separately, "import as" as a language enhancement.</b></div><div class=""><b class=""><br class=""></b></div><div class="">-- E</div></div></div><div class=""><br class=""></div></body></html>