[Proposal] Swift 2.2: #if swift language version

I could (assuming I’m the David you’re referring to), though it will probably be towards the end of the week or early next week before I get a chance to get to it.

-David

···

On Jan 4, 2016, at 1:03 PM, Drew Crawford <drew@sealedabstract.com> wrote:

The swift package manager is currently considering its own define <#if SWIFT_PACKAGE_MANAGER by drewcrawford · Pull Request #105 · apple/swift-package-manager · GitHub, so it's now the second official project that could benefit from this syntax.

David, any interest in writing this up?

On Jan 3, 2016, at 4:48 AM, Goffredo Marocchi <panajev@gmail.com <mailto:panajev@gmail.com>> wrote:

+1 from me as well, supporting conditional compilation when the two versions of foundation differ and may differ for the foreseeable future seems a must on this end.

Sent from my iPhone

On 3 Jan 2016, at 10:12, Drew Crawford via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

If we are going to support something like this, I’d rather see it be something everyone could leverage as there are many use cases for this feature:

if available("package-name", "1.2.*")
#endif

Big +1.

I've asked specifically to get some kind of conditional compilation on corelibs-foundation <https://lists.swift.org/pipermail/swift-corelibs-dev/Week-of-Mon-20151228/000287.html&gt; being used. corelibs-founcation is currently incompatible with Darwin Foundation, and so it is impractical to make a single codebase build for both.

But building the same application against both Foundations and spotting differences is one of the important ways we're going to spot bugs.

So I think the code quality of Foundation ultimately hinges on getting some feature like this in the language.

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution