Skip to content

Commit

Permalink
Unconditionally define range(start, stop)
Browse files Browse the repository at this point in the history
See #640.
  • Loading branch information
martinholters committed Jan 22, 2019
1 parent 58c0b6e commit 71ef735
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1860,8 +1860,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 @@ -51,3 +51,7 @@ else
import Base.@irrational
import Base.LinAlg.BLAS.@blasfunc
end

# to be deprecated:

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

0 comments on commit 71ef735

Please sign in to comment.