> Regarding how this affects sorting methods though, some people (myself 
> included) like the simplicity of being able to do the following:
> 
>       myArray.sort(>) // If array is of Comparable elements, just throw in 
> the operator

That is extremely convenient. With my proposed extensions, it's actually 
writeable as this:

        myArray.sorted { ($0 <=> $1).reversed() }

But that's obviously much less convenient. It's also equivalent to this:

        myArray.sorted { $1 <=> $0 }

Which means, with the proper higher-order function, it's the same as this:

        myArray.sorted(flip(<=>))

-- 
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to