<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><div>On Jun 9, 2016, at 3:04 AM, Jordan Rose <<a href="mailto:jordan_rose@apple.com">jordan_rose@apple.com</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 8, 2016, at 12:02, Thorsten Seitz 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 style="font-family: Helvetica; font-size: 12px; 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;" class=""><blockquote type="cite" class=""><div class=""><br class="Apple-interchange-newline">Am 07.06.2016 um 22:27 schrieb L Mihalkovic <<a href="mailto:laurent.mihalkovic@gmail.com" class="">laurent.mihalkovic@gmail.com</a>>:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; 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;"><div class=""><br class="Apple-interchange-newline">On Jun 7, 2016, at 9:47 PM, Thorsten Seitz <<a href="mailto:tseitz42@icloud.com" class="">tseitz42@icloud.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; 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;"><br class="Apple-interchange-newline"><br class="">Am 07.06.2016 um 20:11 schrieb L Mihalkovic via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>>:<br class=""><br class=""></div><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; 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;"><div class=""><div class=""><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;">T1 =======</div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);"><span class="" style="font-variant-ligatures: no-common-ligatures;">import</span><span class="" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space"> </span>Lib1</span></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);"><span class="" style="font-variant-ligatures: no-common-ligatures;">var</span><span class="" style="color: rgb(49, 89, 93);"><span class="Apple-converted-space"> </span>str =<span class="Apple-converted-space"> </span></span><span class="" style="color: rgb(49, 89, 93);">func2</span><span class="" style="color: rgb(49, 89, 93);">()<span class="Apple-tab-span" style="white-space: pre;">        </span>// lib1</span></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);"><div class="" style="margin: 0px; line-height: normal; color: rgb(187, 44, 162);"><span class="" style="font-variant-ligatures: no-common-ligatures;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal; min-height: 14px;">T2 =======</div><div class="" style="margin: 0px; line-height: normal; color: rgb(187, 44, 162);"><span class="" style="font-variant-ligatures: no-common-ligatures;">import</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> Lib1</span></div><div class="" style="margin: 0px; line-height: normal; color: rgb(187, 44, 162);"><span class="" style="font-variant-ligatures: no-common-ligatures;">import</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures;">func</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> Lib2.</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);">func2</span></div><div class="" style="margin: 0px; line-height: normal; color: rgb(187, 44, 162);"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">var</span> str = func2()<span class="Apple-tab-span" style="white-space: pre;">        </span>// lib2</span></div></span></div></div></div></blockquote><div class="" style="font-family: Helvetica; font-size: 12px; 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;"><br class=""></div><span class="" style="font-family: Helvetica; font-size: 12px; 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; float: none; display: inline !important;">Shouldn't func2() be ambiguous here? It is imported from Lib1 and from Lib2.</span><div class="" style="font-family: Helvetica; font-size: 12px; 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;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; 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;">-Thorsten </div></div></blockquote><div class="" style="font-family: Helvetica; font-size: 12px; 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;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; 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;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; 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;">no, that is precisely the point .. it works!! I am able to override whatever my laziness brought into scope from Lib1 (caused by my * import) with a meticulously chosen implementation from Lib2. It is brilliant. extensions on the other hand work differently (although something could undoubtedly be done about them, I cannot entirely convince myself that it is time well spent. It would be if that could be a stepping stone form something else (which I have not been able to identify so far).</div></div></blockquote><div class=""><br class=""></div>So it is dependent on the order of the imports? That’s rather fragile IMO and I would prefer having to solve clashes explicitly independent of import order, e.g. by having to hide the version from Lib1:</div><div style="font-family: Helvetica; font-size: 12px; 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;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; 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;" class="">import Lib1 hiding func2 // strawman syntax</div><div style="font-family: Helvetica; font-size: 12px; 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;" class="">import func Lib2.func2</div></div></blockquote><br class=""></div><div>It doesn’t depend on the order, but it <i class="">does</i> consider naming a specific top-level value to be a “better” choice than importing the whole module, on the grounds that you wouldn’t have written it that way otherwise.</div></div></blockquote><div><br></div><div>Yes, I'm sorry. i should have written my example the other way around to show that swift consistently chooses specific over implied.</div><div><br></div><blockquote type="cite"><div><div><br class=""></div><div>(I’ve been lukewarm on the entire feature of selective imports for a while since there are often a lot of helpers in the same module (think UITableView and UITableViewDataSource). We do seem to be gravitating towards making helper things nested, though (see <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0086-drop-foundation-ns.md" class="">SE-0086</a>).)</div><div><br class=""></div><div>This is getting a little off-topic from the problem of disambiguating <i class="">members,</i> though.</div><div><br class=""></div><div>Jordan</div><br class=""></div></blockquote></body></html>