<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></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="">Le 13 mai 2016 à 11:05, Pyry Jahkola &lt;<a href="mailto:pyry.jahkola@iki.fi" class="">pyry.jahkola@iki.fi</a>&gt; a écrit :</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class=""><div class=""><div class=""><font class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""></span></font></div></div><blockquote type="cite" class=""><div class=""><div class=""><font class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">Gwendal Roué wrote:<br class=""></span></font></div><div class=""><font class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></font></div></div><div class=""><font class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">`#if import Foo` can not deal with the fact that a single source file may have to perform the importability test several times.</span></font></div></blockquote><br class=""></div><div class="">This would be less of a problem if conditional imports like that worked locally in all scopes of code, so you could write just</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; func foo() {</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; #if import UIKit</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Actually use UIKit...</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; #endif</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; // UIKit no longer visible.</div><div class="">&nbsp; &nbsp; }</div><div class=""><br class=""></div><div class="">— Pyry</div></div></div></blockquote><br class=""></div><div>Neat idea!</div><div><br class=""></div><div>Gwendal</div><div><br class=""></div><br class=""></body></html>