JuliaLang/julia — pull request #6699 by karbarcca (2014-04-30 19:41:16+00:00)
Title: Tweaks to StepRange

The `issorted` and `in` changes are pretty straightforward, using the step for comparison. `sort` and `sortperm` remove the `T<:Real` restriction to apply to `StepRange` as well. All `test/ranges.jl` tests still pass with these changes, though I can add some more and try to break things if needed.

The introduction of `steprem` is annoying, but surprisingly minimal to allow full support for different step types than the difference between start and stop. The reasoning is that most Ordinal types shouldn't have to worry because the fallback to `(stop-start) % step` should work, but it allows for overloading (similar to how I'm overloading `length`).

Support methods I'm using to get range functionality for dates: https://github.com/karbarcca/Dates.jl/blob/master/src/periods.jl#L115
Relevant tests the date ranges are passing with these changes: https://github.com/karbarcca/Dates.jl/blob/master/test/runtests.jl#L1343