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

Kevin Ballard kevin at sb.org
Mon Aug 29 23:00:12 CDT 2016

On Sun, Aug 28, 2016, at 01:28 PM, Dave Abrahams via swift-evolution wrote:
> on Fri Aug 26 2016, Kevin Ballard <swift-evolution at swift.org> wrote:
> > Goddammit. I completely missed this thread, because Pipermail
> > regularly decides not to deliver the swift-evolution-announce version
> > of review threads (which means they bypass my inbox). Why does it do
> > this? Most of the emails get delivered, but it just skips some of
> > them, and I keep ending up missing review threads because of it.
> >
> > 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.
> It's very easy to write your own versions of these operators, should you
> choose to keep using them.  From that standpoint, I don't see why the
> impact has to be huge.

You could make the same argument for a lot of stuff the stdlib provides. For example, let's remove Optional.map since it's trivial to reimplement.

The problem is, if I have to reimplement this thing in every single project I touch, that's a huge impact. I shouldn't have to copy & paste a bunch of code into every single project. I'm already doing this with my replace(_:with:) function that you guys (Swift core team; I forget exactly who) didn't like, but that's at least simpler than the Optional comparison operators, and is only one function (and it's easier to work around the lack of this function if I don't want to reimplement it for a particular use).


More information about the swift-evolution mailing list