JuliaLang/julia — pull request #1786 by simonster (2012-12-19 03:06:48+00:00)
Title: RFC: Fix search_sorted_*r and search_sorted_*by

search_sorted_r and search_sorted_by and their variants were introduced by #1691. At the moment, these functions do the same thing as search_sorted (search_sorted_by takes more arguments, but these arguments are ignored). This is presumably because the `isless` call needs to be turned into an expression using `lt`.

With this patch, the `_r` variants of these functions become a little confusing. search_sorted_first_r finds the index of the last value of a reverse-sorted vector >= x (rather than the first), and search_sorted_last_r finds the index of the first value of a reverse-sorted vector <= x (rather than the last). Maybe we should switch or change the names.