[swift-evolution] [DRAFT] Aliasing the OS X Platform Configuration Test

Erica Sadun erica at ericasadun.com
Thu Jun 16 12:04:54 CDT 2016


> 
> On Jun 16, 2016, at 10:53 AM, Charlie Monroe <charlie at charliemonroe.net> wrote:
>> * the configuration test should not remain as #if os(OSX) because that's the wrong name
> 
> Agreed.
> 
>> * replacing OSX with macOS places an undue burden on existing code
> 
> Since Swift 3.0 is a code-breaking change my guess is that there is no burden if the Xcode migration assistent automatically changes all #if os(osx) to #if os(macos), thus deprecating the term osx, not burdening the developer at all.
> 
>> * aliasing the two may cause issues down the road ("why does this test have two names") but I think developers are smart enough to figure out why both variations exist
> 
> I don't see them as two different OSs, mostly since version-wise it's OS X 10.11 and macOS 10.12. It's the same OS, different name - it IMHO should be an alias. 
> 
> If iOS was renamed to phoneOS and kept versioning, you'd still expect #if os(ios) to be matched when targetting phoneOS and vice-versa.

These are excellent points. I've updated the alternatives considered section. Reload.
https://gist.github.com/erica/f53fa6cfef9e5cf17ab139f7528edde2

> If you need to differentiate between versions of the OS, there are #if available(*) "macros" or simply NSAppKitVersion constants.
> 
>> * developers can and will still deploy to OS X for Yoze and El Cap
> 
> Sure, but with Xcode 8 and Swift 3, the SDK will still be for macOS 10.12, so it could simply say #if os(macos), even when targetting prior OSs.
> 
> All, of course, unless you want to apply these changes to Swift 2.x as well.


-- E

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160616/285b39d3/attachment.html>


More information about the swift-evolution mailing list