Skip to content

Commit

Permalink
Merge pull request #642 from JuliaLang/mh/always_define_range
Browse files Browse the repository at this point in the history
Always define `range(start, stop)`
  • Loading branch information
martinholters authored Jan 25, 2019
2 parents dc9fd0a + 47bfc82 commit 64697fd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ Currently, the `@compat` macro supports the following syntaxes:
* `Complex32`, `Complex64`, and `Complex128` are now `ComplexF16`, `ComplexF32`, and
`ComplexF64`, respectively ([#24647]).

* `trace` is now `tr`, available as `Compat.tr` (#26365).
* `trace` is now `tr`, available as `Compat.tr` ([#26365]).

* `JULIA_HOME` is now `Sys.BINDIR`, available in the `Compat.Sys` submodule. ([#25102])

Expand Down Expand Up @@ -547,6 +547,7 @@ includes this fix. Find the minimum version from there.
[#25990]: https://github.com/JuliaLang/julia/issues/25990
[#25998]: https://github.com/JuliaLang/julia/issues/25998
[#26009]: https://github.com/JuliaLang/julia/issues/26009
[#26039]: https://github.com/JuliaLang/julia/issues/26039
[#26069]: https://github.com/JuliaLang/julia/issues/26069
[#26089]: https://github.com/JuliaLang/julia/issues/26089
[#26149]: https://github.com/JuliaLang/julia/issues/26149
Expand Down Expand Up @@ -575,3 +576,4 @@ includes this fix. Find the minimum version from there.
[#28295]: https://github.com/JuliaLang/julia/issues/28295
[#28302]: https://github.com/JuliaLang/julia/issues/28302
[#28303]: https://github.com/JuliaLang/julia/issues/28303
[#28708]: https://github.com/JuliaLang/julia/issues/28708
10 changes: 10 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1869,8 +1869,18 @@ if VERSION < v"0.7.0-beta2.143"
end
end

# This definition should be modified to throw an ArgumentError if neither
# `step` nor `length` are given and be limited to VERSION < v"1.1.0-DEV.506".
# However, there is a release with this definition, so we need to keep it around
# to avoid breakage.
if VERSION < v"1.1.0-DEV.506"
range(start, stop; kwargs...) = range(start; stop=stop, kwargs...)
else
function __init__()
@eval Base begin
range(start, stop; kwargs...) = range(start; stop=stop, kwargs...)
end
end
end

include("deprecated.jl")
Expand Down
4 changes: 4 additions & 0 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ Base.@deprecate_binding AsyncCondition Base.AsyncCondition
Base.@deprecate_binding promote_eltype_op Base.promote_eltype_op
@eval Base.@deprecate_binding $(Symbol("@irrational")) Base.$(Symbol("@irrational"))
@eval Base.@deprecate_binding $(Symbol("@blasfunc")) Compat.LinearAlgebra.BLAS.$(Symbol("@blasfunc"))

# to be deprecated:

# * `range(start, stop)` (without either `length` nor `step` given)

0 comments on commit 64697fd

Please sign in to comment.