<div dir="ltr">In addition to what Stephen said, it seems that it would be good to use comparison operators on objects that can be represented or visualized as a value like NSDate, NSIndexPath, and NSNumber. Although, using comparison operators on NSString or Strings would not be much clear to a reader of the code since there are lots of ways that we can compare strings, such as character count, or alphabetical order while being case insensitive, etc.<div><br></div><div>Chris<br><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 7, 2015 at 1:48 AM Stephen Celis &lt;<a href="mailto:stephen.celis@gmail.com">stephen.celis@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Seems to me that anything with `-compare:` could conform to Comparable. The list, however, is surprisingly short, and half bridge over to native Swift types that are already Comparable:<div><br></div>- [NSDate compare:]<br><div>- [NSIndexPath compare:]<br></div>- [NSNumber compare:]<br><div>- [NSString compare:]<br><br>Looks like NSIndexPath may be the only other contender.</div><div><br></div><div>Stephen<br><div><br><div><blockquote type="cite"></blockquote></div></div></div></div><div style="word-wrap:break-word"><div><div><div><blockquote type="cite"><div>On Dec 6, 2015, at 11:47 AM, Tony Parker via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br></blockquote></div></div></div></div><div style="word-wrap:break-word"><div><div><div><blockquote type="cite"><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Hi Chris,</span><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Thanks for bringing this idea to the list.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Is NSDate really the only thing that we want to conform to comparable, or is there a set of classes which should do so? I’d like to think about the larger set of consequences here (and if possible, deal with one coherent answer for all of Foundation rather than do these classes one at a time).<div><div><br></div><div>- Tony</div><div><br><div><blockquote type="cite"><div>On Dec 5, 2015, at 3:36 PM, Chris Amanse via swift-corelibs-dev &lt;<a href="mailto:swift-corelibs-dev@swift.org" target="_blank">swift-corelibs-dev@swift.org</a>&gt; wrote:</div><br><div><div dir="ltr">Hello Swift Developers,<div><br></div><div>I think it&#39;s a good idea to conform NSDate to the Comparable protocol, so instead of using:</div><div><br></div><div>if someDate.compare(today) == .OrderedAscending { }</div><div><br></div><div>Developers can easily compare using compare dates using comparison operators:</div><div><br></div><div>if someDate &lt; today { }</div><div><br></div><div>In my opinion, the code is still readable if developers use comparison operators on NSDates.</div><div><br></div><div>Here&#39;s a quick implementation from my swift-corelibs-foundation fork: <a href="https://github.com/chrisamanse/swift-corelibs-foundation/commit/3c4eff643c5271de5bec2461798051347be13916" target="_blank">https://github.com/chrisamanse/swift-corelibs-foundation/commit/3c4eff643c5271de5bec2461798051347be13916</a></div><div><br></div><div>Thank you.</div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=U7z7oSqRMSwdl2rYt9JJ4zIFaeg4R-2FxExg9xndDuCbwubPQSgA-2BzXy1o-2FW-2BbadaFYFQKc49KZNc8-2Bhm-2Bve7MsFXaVjMk3bYwD-2BuMDedGGtK9letYRlNnQOD5wcEuL-2BLVMeJ0IdIQ5gTVD2BPWoBuSQeXGBPNYOZjO1khjdjNwQZSjZInQ-2FUFgGc-2BOaNkKgvklAxkJO4boWVkFdD5iW-2BrQ8LvozsLCPhfmCGAUQ9Clks-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0px!important;margin:0px!important;padding:0px!important"><span> </span>_______________________________________________<br>swift-corelibs-dev mailing list<br><a href="mailto:swift-corelibs-dev@swift.org" target="_blank">swift-corelibs-dev@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-corelibs-dev" target="_blank">https://lists.swift.org/mailman/listinfo/swift-corelibs-dev</a><br></div></blockquote></div><br></div></div></div></div></blockquote></div></div></div></div><div style="word-wrap:break-word"><div><div><div><blockquote type="cite"><div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=5xu02FVv-2BCbxTLHpBsC0RVeXVC5uCln3pUIIeLTlIi0rK7Pz4CRuhprt4osHX1fVaXQEDuRsUda0uQ-2BmyR9xXW-2F6-2Bv6Le0THgB-2FRAuy1FH0CC6JJ5aPfr0c-2BuMhcbUMQY5FKaTTypxxnNSb-2BC-2FafEzAhzGGZsP-2FUOLYYFr0kfkZmTM-2FuAHXgS6Xww7AdadeDZJd6EGDMOdNtkBRpJRIgsNk1zZTzSqID3ziB-2BIBVEPI-3D" alt="" width="1" height="1" border="0" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;min-height:1px!important;width:1px!important;border-width:0px!important;margin:0px!important;padding:0px!important"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important"><span> </span></span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">_______________________________________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">swift-evolution mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="mailto:swift-evolution@swift.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">swift-evolution@swift.org</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br></div></div></div></blockquote></div></div></div>