[swift-evolution] [Accepted] SE-0121: Remove Optional Comparison Operators

Chris Lattner clattner at apple.com
Sat Aug 27 11:21:50 CDT 2016


On Aug 26, 2016, at 6:01 PM, Kevin Ballard <kevin at sb.org> wrote:
> This change is going to have a HUGE impact for me. I use this sort of comparison _all the time_ and find it incredibly useful, and have had literally zero bugs caused by this. Surely I can't be the only one who uses this. I am not looking forward to copying & pasting a reimplementation of the comparison functions into every single project I work on.

Hi Kevin,

This fits into a more general idea of introducing a better “ordering” concept defined in terms of three way comparison results (less/equal/greater).  This would then become the primitive that sort would be built on, and would allow deriving the user friendly operators like < and <=.

There was a sketch of this posted to swift-evolution several weeks ago, but I don’t have a link offhand.

-Chris



More information about the swift-evolution mailing list