On Tue, Jan 26, 2016 at 3:04 PM, Robert S Mozayeni via swift-evolution < swift-evolution@swift.org> wrote:
Discussion is fine, of course, but you should bring this up with Tony or
Philippe on the swift-corelibs-dev list.
I discussed this briefly with Philippe through GitHub, and he suggested I
file a proposal:
Made some upgrades to NSOperatingSystemVersion by rsmoz · Pull Request #240 · apple/swift-corelibs-foundation · GitHub
I’m still interested in getting feedback from the community before I
actually draft a formal proposal.
-Robert
On Jan 26, 2016, at 5:59 PM, Jordan Rose <jordan_rose@apple.com> wrote:
Since the corelibs version of Foundation is meant to match the Darwin
version (for the most part), this is more a question for the owners of the
Darwin Foundation framework (and overlay). Fortunately, they're the same
people maintaining the corelibs port (Tony Parker, Philippe Hausler, and
others), and they have the freedom to make such decisions without going
through the full Swift evolution process.
Discussion is fine, of course, but you should bring this up with Tony or
Philippe on the swift-corelibs-dev list.
Jordan
On Jan 26, 2016, at 3:32, Robert S Mozayeni via swift-evolution < > swift-evolution@swift.org> wrote:
Hello.
I’ve recently forked swift-corelibs-foundation and implemented Comparable
for NSOperatingSystemVersion.
What’s the point of this? Well, in the words of a friend, "It’s a value
type with a clear ordering, why not?”.
I have also added a new initializer that allows something like
NSOperatingSystemVersion(10,11,4)
instead of requiring
NSOperatingSystemVersion(majorVersion: 10, minorVersion: 11,
patchVersion: 4)
Not only is this new initializer *easier* *to type*, but it also much
clearer, especially when one is quickly scanning through code.
My changes:
Implemented Comparable on, and added initializer to, NSOperatingSyste… · rsmoz/swift-corelibs-foundation@e3db7ae · GitHub
Also, the Version struct in swift-package-manager has an extension for
Comparable, as well as concise initializer:
https://github.com/apple/swift-package-manager/blob/39fdccc74fcb11bc0a352b73fb7e656ba6843ff4/Sources/PackageDescription/Version.swift#L23
Tests:
Added tests for NSOperatingSystemVersion · rsmoz/swift-corelibs-foundation@db44f29 · GitHub
I’d like to hear your opinions on my changes. For instance, do you think
implementing Comparable for NSOperatingSystemVersion would best be done in
an extension? That’s how SwiftPM does it.
Best,
Robert Mozayeni
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution