<div dir="ltr">This feature makes logical sense, and I'm for it, as long as documentation is clear that it's a lexicographical comparison. I like the simpler initializer too.<div><div class="gmail_extra">
<br><div class="gmail_quote">On Tue, Jan 26, 2016 at 3:04 PM, Robert S Mozayeni via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><span class=""><div><blockquote type="cite"><div style="word-wrap:break-word"><div>Discussion is fine, of course, but you should bring this up with Tony or Philippe on the swift-corelibs-dev list.</div></div></blockquote><br></div></span><div>I discussed this briefly with Philippe through GitHub, and he suggested I file a proposal: <a href="https://github.com/apple/swift-corelibs-foundation/pull/240" target="_blank">https://github.com/apple/swift-corelibs-foundation/pull/240</a></div><div><br></div><div>I’m still interested in getting feedback from the community before I actually draft a formal proposal.</div><span class=""><font color="#888888"><div><br></div><div>-Robert</div></font></span><div><div class="h5"><div><br></div><br><div><blockquote type="cite"><div>On Jan 26, 2016, at 5:59 PM, Jordan Rose <<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>> wrote:</div><br><div><div style="word-wrap:break-word"><div>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.</div><div><br></div><div>Discussion is fine, of course, but you should bring this up with Tony or Philippe on the swift-corelibs-dev list.</div><div><br></div><div>Jordan</div><div><br></div><br><div><blockquote type="cite"><div>On Jan 26, 2016, at 3:32, Robert S Mozayeni via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br><div><div style="word-wrap:break-word"><div>Hello.</div><div><br></div><div>I’ve recently forked swift-corelibs-foundation and implemented Comparable for NSOperatingSystemVersion.</div><div><br></div><div>What’s the point of this? Well, in the words of a friend, "It’s a value type with a clear ordering, why not?”.</div><div><br></div><div><br></div><div><br></div><div>I have also added a new initializer that allows something like</div><div><br></div><div><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;white-space:pre-wrap;background-color:rgb(234,255,234)">NSOperatingSystemVersion(10,11,4)</span></div><div><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;white-space:pre-wrap;background-color:rgb(234,255,234)"><br></span></div><div>instead of requiring</div><div><br></div><div><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;white-space:pre-wrap;background-color:rgb(234,255,234)">NSOperatingSystemVersion(</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;white-space:pre-wrap;background-color:rgb(234,255,234)">majorVersion: 10, minorVersion: 11, patchVersion: 4)</span></div><div><br></div><div>Not only is this new initializer <i>easier</i> <i>to type</i>, but it also much clearer, especially when one is quickly scanning through code.</div><div><br></div><div><br></div><div><br></div><div>My changes: <a href="https://github.com/rsmoz/swift-corelibs-foundation/commit/e3db7ae2d7f4ba27ae5597e157b41a4b34def468" target="_blank">https://github.com/rsmoz/swift-corelibs-foundation/commit/e3db7ae2d7f4ba27ae5597e157b41a4b34def468</a></div><div><br></div><div>Also, the Version struct in swift-package-manager has an extension for Comparable, as well as concise initializer:</div><div><a href="https://github.com/apple/swift-package-manager/blob/39fdccc74fcb11bc0a352b73fb7e656ba6843ff4/Sources/PackageDescription/Version.swift#L23" target="_blank">https://github.com/apple/swift-package-manager/blob/39fdccc74fcb11bc0a352b73fb7e656ba6843ff4/Sources/PackageDescription/Version.swift#L23</a></div><div><br></div><div><br></div><div>Tests: <a href="https://github.com/rsmoz/swift-corelibs-foundation/commit/db44f29e42f29ad0fe35f69ac83d853453c77bc6" target="_blank">https://github.com/rsmoz/swift-corelibs-foundation/commit/db44f29e42f29ad0fe35f69ac83d853453c77bc6</a></div><div><br></div><div><br></div><div>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.</div><div><br></div><div><br></div><div>Best,</div><div>Robert Mozayeni</div></div>_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></blockquote></div><br></div></div></blockquote></div><br></div></div></div><br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div></div></div>