-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Always define range(start, stop)
#642
Conversation
Well, the warning could be avoided with function __init__()
@eval Base begin
range(start, stop; kwargs...) = range(start; stop=stop, kwargs...)
end
end but that feels so wrong I'm not sure I don't prefer the warning... Better ideas? |
c914edc
to
20e5090
Compare
Thinking about this again, it would be nice to deprecate @ararslan, any comments? |
if VERSION < v"1.1.0-DEV.506" | ||
range(start, stop; kwargs...) = range(start; stop=stop, kwargs...) | ||
else | ||
function __init__() | ||
@eval Base begin |
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.
This is really heinous... I think at one point @yuyichao mentioned that it's bad for precompilation as well, though I fully admit to not understanding the details on why.
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.
Doing @eval Base
outside __init__
runs afoul of precompilation (and gives a warning to that effect).
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.
So it's legit to do in __init__
, just not in the package body?
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'd hope so (to the extent it's ever legit to eval
into Base).
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.
to the extent it's ever legit to
eval
into Base
...which I thought was never
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.
In any case, I haven't found a better way of achieving the (short-term) goal of providing range(start, stop)
on Julia 1.1.
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.
Yeah, I'm hesitant about this approach but I don't have a better suggestion.
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.
Great, so we're in agreement here. Who else might have something to contribute here that could bring us to a decision?
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.
@StefanKarpinski, JuliaLang/julia#30374 (comment) means you have to chime in here 😄
6f6f265
to
47bfc82
Compare
Barring objections, I think I'll merge this tomorrow. Even if the implementation has flaws (and I'm not saying it has, just that it might), it's still a step forward IMO. |
Ref. #640 and JuliaLang/julia#30374 (comment). I aim at implementing option 3 mentioned in the latter, i.e. tag a release after this has been merged, then remove the offending functionality and tag another release.
Downside here is
of course.