-
-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
range(start, stop; length, step) #633
Changes from 1 commit
966cdf0
f63c02c
16b7b64
021cfe6
4071b02
025c138
fbc52c3
5f7fd09
e5f549b
8d8906c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1839,6 +1839,12 @@ if VERSION < v"0.7.0-beta2.143" | |
end | ||
end | ||
|
||
if v"1.0" ≤ VERSION < v"1.1" | ||
# https://github.com/JuliaLang/julia/pull/28708 | ||
Base.range(start, stop; length::Union{Integer,Nothing}=nothing, step=nothing) = | ||
Base._range(start, step, stop, length) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we should be calling this internal function. Why not use the old There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I took it from the un merged PR, but good point. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Calling the lowering function does make the code simpler than the various cases using the current There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't just |
||
end | ||
|
||
include("deprecated.jl") | ||
|
||
end # module Compat |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1518,4 +1518,9 @@ end | |
3 4 3 4 3 4] | ||
@test repeat([1, 2], 1, 2, 3) == [x for x in 1:2, y in 1:2, z in 1:3] | ||
|
||
# [1.0, 1.1) | ||
if v"1.0" ≤ VERSION < v"1.1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even if we only define the method here prior to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure. |
||
@test range(0, 5, length = 6) == 0.0:1.0:5.0 | ||
end | ||
martinholters marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we support this on earlier versions, too? Also, we probably should either wait until JuliaLang/julia#28708 has been merged and we know the exact upper bound, or make this depend on whether the new method is defined. (By looking at
methods(range, Tuple{Any,Any})
, maybe?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Letting go by JuliaLang/julia#28708 (comment) since it is has already been decided the feature will be added in the next minor release. I can test the
@isdefined
method as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but we'd need the
XXX
in v"1.1.0-DEV.XXX" for the version bound here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see no reason to merge it now then, why wait?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"it" referring to JuliaLang/julia#28708? Agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I rebased it just now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can have it merged now (no more planned patch releases), I can extract the exact version to use here after it has been merged.