<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=""><div class=""><u class=""><b class="">Description</b></u></div><div class=""><br class=""></div><div class="">In an effort to both (1) reduce boilerplate code, and (2) promote cross-platform reusability I propose that we implement the following&nbsp;<b class="">Import Conditional Operators</b>:&nbsp;</div><div class=""><br class=""></div><div class=""><b class="">`||`&nbsp;</b>and `<b class="">&amp;&amp;`</b></div><div class=""><b class=""><br class=""></b></div><div class="">Currently, import conditionals must be implemented like so:</div><div class=""><br class=""></div><div class="">```</div><div class="">#if os(Linux) || os(FreeBSD)<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>import Glibc<br class="">#else<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>import Darwin<br class="">#endif</div><div class="">```</div><div class=""><br class=""></div><div class="">With <b class="">import&nbsp;conditional operators</b>&nbsp;this would be condensed to:</div><div class=""><br class=""></div><div class="">```</div><div class="">import Glibc || Darwin</div><div class="">```</div><div class=""><br class=""></div><div class="">The first library/framework (Glibc) would be imported if found and the the second (Darwin) only in the event the first should fail.</div><div class=""><br class=""></div><div class=""><b class=""><u class="">Other Caveats:</u></b></div><div class=""><b class=""><u class=""><br class=""></u></b></div><div class=""><b class="">(A) — &nbsp;</b>we could limit this to one conditional operator per import line OR we could implement order of operations. Obviously, there are tradeoffs of both that we should discuss.</div><div class=""><br class=""></div><div class=""><b class="">(B) —</b>&nbsp;if-conditional statements currently explicitly show the import conditions (i.e., os(Linux) || os(FreeBSD)) this would be a detriment to this new feature. I would argue that the reduction of boilerplate code would in itself be worth this abstraction.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">--</div><div class="">Sean Alling</div><div class=""><br class=""></div></body></html>