JuliaLang/julia — pull request #6326 by JeffBezanson (2014-03-31 07:38:41+00:00)
Title: ordinal range implementation, fixes #5585

Adds `OrdinalRange`, `StepRange`, `UnitRange`, and `range`.

* Supports different step and element type, and can do arithmetic in a lifted domain to handle ordinals and small integer types.

* Overflow is checked in `length`, and aside from that large ranges work, except for iterating over `typemin(Int):typemax(Int)`.

* Ranges with a step of 0 are no longer allowed.

The requirements on an ordinal type `T` are `D=T-T`, `T+D`, `T