|
50 | 50 | range(start, stop; length, step)
|
51 | 51 | range(start; length, stop, step)
|
52 | 52 | range(;start, length, stop, step)
|
53 |
| - range(stop) |
54 | 53 |
|
55 | 54 | Construct a specialized array with evenly spaced elements and optimized storage (an [`AbstractRange`](@ref)) from the arguments.
|
56 | 55 | Mathematically a range is uniquely determined by any three of `start`, `step`, `stop` and `length`.
|
@@ -90,9 +89,6 @@ julia> range(stop=10, step=1, length=5)
|
90 | 89 | julia> range(start=1, step=1, stop=10)
|
91 | 90 | 1:1:10
|
92 | 91 |
|
93 |
| -julia> range(5) |
94 |
| -Base.OneTo(5) |
95 |
| -
|
96 | 92 | julia> range(; length = 10)
|
97 | 93 | Base.OneTo(10)
|
98 | 94 |
|
@@ -136,7 +132,7 @@ A `UnitRange` is not produced if `step` is provided even if specified as one.
|
136 | 132 | function range end
|
137 | 133 |
|
138 | 134 | range(start; stop=nothing, length::Union{Integer,Nothing}=nothing, step=nothing) =
|
139 |
| - _range_positional(start, step, stop, length) |
| 135 | + _range(start, step, stop, length) |
140 | 136 |
|
141 | 137 | function range(start, stop; length::Union{Integer,Nothing}=nothing, step=nothing)
|
142 | 138 | # For code clarity, the user must pass step or length
|
|
156 | 152 | range(;start=nothing, stop=nothing, length::Union{Integer, Nothing}=nothing, step=nothing) =
|
157 | 153 | _range(start, step, stop, length)
|
158 | 154 |
|
159 |
| -range(stop::Integer) = range_stop(stop) |
160 |
| - |
161 |
| -_range_positional(stop::Any , step::Nothing, ::Nothing, len::Nothing) = |
162 |
| - _range(nothing, nothing, stop, nothing) # One arg interpreted as `stop`, could be nothing |
163 |
| -_range_positional(start::Any , step::Any , stop::Any, len::Any) = |
164 |
| - _range(start, step, stop, len) |
165 |
| - |
166 | 155 | _range(start::Nothing, step::Nothing, stop::Nothing, len::Nothing) = range_error(start, step, stop, len)
|
167 | 156 | _range(start::Nothing, step::Nothing, stop::Nothing, len::Any ) = range_length(len)
|
168 | 157 | _range(start::Nothing, step::Nothing, stop::Any , len::Nothing) = range_stop(stop)
|
|
0 commit comments