<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="">Thanks for this, Erica. &nbsp;A huge +1 from me.<div class=""><br class=""></div><div class="">- Will</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 10, 2016, at 6:15 PM, Erica Sadun via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I would like to bring the compiler directive discussion back to life. Introducing new conditionals&nbsp;<div class="">has been raised at several points, poked at, and then died down and gone nowhere.<div class=""><br class=""></div><div class=""><div class="">Discussed at a variety of times directives mentioned on-list include</div><div class=""><br class=""></div><div class=""><ul style="box-sizing: border-box; padding: 0px 0px 0px 2em; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255); margin-top: 0px !important;" class=""><li style="box-sizing: border-box;" class="">Apple/Non-Apple Platform to differentiate imports. The current art allows&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">if os(Linux)</code>&nbsp;but does not categorize Apple platforms as an entire coherent group.&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">#if os(Darwin) // os(iOS) || os(OSX) || os(watchOS) || os(tvOS)</code>, expandable for any new OS's. Kevin Ballard writes, "Without this, I think people are going to be tempted to write&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">if !os(Linux)</code>&nbsp;instead of writing out all 4 Apple platforms, and this is unfortunate because it makes the assumption that Linux is the only non-Apple platform, and that's simply not true."</li><li style="box-sizing: border-box;" class="">Common UIKit platform:&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">#if os(iOS) || os(tvOS)</code>&nbsp;or general module availability:&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">#if available(AppKit)</code>,&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">#if available(UIKit)</code>&nbsp;(Plus a proposal to replace&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">os</code>&nbsp;with&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">platform</code>) ("Is the target a common UIKit platform? Can it import UIKit?")</li><li style="box-sizing: border-box;" class="">Linux distribution check ("Is this target a specific Linux distro? Is it at least this distro or later?")</li><li style="box-sizing: border-box;" class="">Is this a Unixy-platform (vs, for example, running on Windows would not be)</li><li style="box-sizing: border-box;" class="">What BSD characteristics does this platform support?</li><li style="box-sizing: border-box;" class="">Simulator/Physical destinations ("Is the target a simulator environment or physical device?")</li><li style="box-sizing: border-box;" class="">Debug/Release builds (bypassing the need for -DDEBUG flags) ("Is the target in Debug or Release mode?")</li><li style="box-sizing: border-box;" class="">DebugAsserts/ReleaseAsserts/FastAsserts</li><li style="box-sizing: border-box;" class="">General conditional flag detection&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">#if config(Debug)</code></li><li style="box-sizing: border-box;" class="">Test-supporting ("Is the target built for running tests?)</li><li style="box-sizing: border-box;" class="">Big-or-little endian</li><li style="box-sizing: border-box;" class="">Architecture families: Is this a 32-or-64-bit target</li><li style="box-sizing: border-box;" class="">Architecture subtypes</li><li style="box-sizing: border-box;" class="">Signed-or-unsigned char</li></ul><div style="box-sizing: border-box; margin-top: 0px; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255); margin-bottom: 0px !important;" class="">Existing build configurations include&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">os()</code>&nbsp;(OSX, iOS, watchOS, tvOS, Linux) and&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">arch()</code>&nbsp;(X86_64, arm, arm64, i386), the literals&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">true</code>&nbsp;and&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">false</code>, and testing for command-line flags defined using&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">-D &lt;#flag#&gt;</code>.</div></div><div class=""><br class=""></div><div class="">I believe these directives involve relatively minor changes, should be easy to implement, and&nbsp;</div><div class="">can be extended over time as needed. It would probably be best to get a sense of which&nbsp;</div><div class="">ones the dev community *really* want and need &nbsp;and push on those to avoid clutter,&nbsp;</div><div class="">but I’d hate to see these languish without getting a proper discussion.</div><div class=""><br class=""></div><div class="">Core team members: Would it best to propose individual changes,&nbsp;</div><div class="">create a small groups of related items, or try to push through a large suite?</div><div class=""><br class=""></div><div class="">-- E</div></div></div><div class=""><br class=""></div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></body></html>