Redundant sort / sortperm options: why?



sort and sortperm take a couple of keyword arguments that appear to be redundant (at least, one of them is a subset of the other): rev and order. That is:

julia> sortperm(a, rev=true) == sortperm(a, order=Base.Order.Reverse)

julia> sortperm(a) == sortperm(a, rev=true, order=Base.Order.Reverse)

Benchmarking suggests no advantage to one over the other.

Is the idea that a custom sorting algorithm (via order) can be automatically reversed with the rev keyword? If not, what is the purpose of having both rev and order?

#2, etc


Ok. Sounds like Ordering is here to stay after reading the github issues.

I think it’s quite a bit more complicated than setting a rev = true/false. Would love a simple blog post to explain what all the Ordering options are about.