> On Jul 11, 2016, at 5:29 PM, Mark Lacey via swift-evolution > <[email protected]> wrote: > > >> On Jul 11, 2016, at 4:56 PM, Jacob Bandes-Storch <[email protected] >> <mailto:[email protected]>> wrote: >> >> Personally I think we should just remove these optional-taking variants of >> the comparison operators. Does anyone agree/disagree? > > I believe that a well-defined ordering of optionals and non-optionals is > required in order to allow sorting an array of optionals.
Yes, I agree that this should work in principle. The problem with this argument (in Swift 3) is that Optional itself can’t conform to comparable, because that requires conditional conformances. You have to use the closure-taking form of sort, at which point, using a more verbose way to compare the optional isn’t completely terrible. -Chris
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
