<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>Agreed, thanks for tracking this, Erica. I want to see this move forward. </div><div><br></div><div>I'd personally like to see:</div><div>- os(darwin) or Apple platform grouping</div><div>- simulator vs physical device</div><div>- test supporting</div><div>- module / UIKit availability</div><div><br></div><div>- Step</div><div><br>On Mar 10, 2016, at 9:26 PM, William Dillon via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8">Thanks for this, Erica. 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 <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> 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 <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 <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> but does not categorize Apple platforms as an entire coherent group. <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 <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> 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: <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> or general module availability: <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>, <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> (Plus a proposal to replace <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> with <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 <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 <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> (OSX, iOS, watchOS, tvOS, Linux) and <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> (X86_64, arm, arm64, i386), the literals <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> and <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 <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 <#flag#></code>.</div></div><div class=""><br class=""></div><div class="">I believe these directives involve relatively minor changes, should be easy to implement, and </div><div class="">can be extended over time as needed. It would probably be best to get a sense of which </div><div class="">ones the dev community *really* want and need and push on those to avoid clutter, </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, </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=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>