-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
deprecated symbol(x...) becomes Symbol(x...) #15995
Conversation
This renaming follows Julia's capitalization of named Types and their constructors.
This renaming follows Julia's capitalization of named Types and their constructors.
I believe you need to update the def of |
👍 Yes, there are many uses of |
@jeffreysarnoff-dev If you wonder why tests failed, deprecation warnings are turned into failures in Travis/AppVeyor. |
I had changed the the methods in base/expr.jl -- Somehow that file did not get included with the pull request. Please close this pull request. I will process all the source files locally to catch each use of 'symbol' and put the changes into a new fork then resubmit the request. Thank you. |
We can leave this PR open, and just force-push when you're ready. |
I have pushed changes to ~67 files (.jl, .md, .rst) relative to ./julia (above /julia/base): |
Looks good. Unfortunately, changes to the same code areas have been merged into master since you forked. Could you rebase on master and fix conflicts? You should also squash into a single commit. |
@nalimilan Now that I know how to do it, I can redo it as a single commit to a current fork. It is much easier to do that than to fiddle with conflicts (I have not done that before) and combining multiple commits into one (which did not work for me last time). |
Whatever's easiest is fine. However, if you want to try to use git, do something like this: git checkout -b patch-3a
git fetch # update origin/master
git rebase -i origin/master
# Now edit the TODO list, using "pick" for the first and "squash" for the rest
# Save and close the file
# Fix any merge conficts
git rebase --continue
git push myfork +patch-3a:/patch-3 # force-push local branch patch-3a to remote branch patch-3 where |
@@ -264,7 +264,7 @@ A_mul_B!(y::AbstractArray, p::ScaledPlan, x::AbstractArray) = | |||
# or odd). | |||
|
|||
for f in (:brfft, :irfft) | |||
pf = symbol(string("plan_", f)) | |||
pf = Symbol(string("plan_", f)) |
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.
Note that usages like this should probably be replaced with Symbol("plan_", f)
.
(Good to take this opportunity to clean up a lot of the |
Note that all improvements noted by @stevengj would better stay in a separate commit, so that one commit only does the systematic renaming. |
symbol( --> Symbol then _Symbol( --> _symbol then deprecated.jl done in one commit |
I just noticed that I forgot to include the pull request number in deprecated.jl. |
@JeffreySarnoff Just make the changes, then |
fixed. should be good to go. |
thank you -- done On Mon, Apr 25, 2016 at 10:19 AM, Milan Bouchet-Valat <
|
Sorry, there are still conflicts with master. See how many commits are included in this branch. If that's easier, open a new clean PR. Also, do you plan to address @stevengj's enhancements while you're at it? |
I will use a new PR and a new branch -- I can address @stevenj's enhancements, are you saying 1 PR two commits or 2 PRs? |
1 PR, 2 commits is the best solution. |
Closing in favor of #16038. |
@@ -29,7 +29,7 @@ convert(::Type{Vector{UInt8}}, s::AbstractString) = bytestring(s).data | |||
convert(::Type{Array{UInt8}}, s::AbstractString) = bytestring(s).data | |||
convert(::Type{ByteString}, s::AbstractString) = bytestring(s) | |||
convert(::Type{Vector{Char}}, s::AbstractString) = collect(s) | |||
convert(::Type{Symbol}, s::AbstractString) = symbol(s) | |||
convert(::Type{Symbol}, s::AbstractString) = Symbol(s) |
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 guess we should remove this one. Calling the constructor from convert
doesn't make sense.
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.
removing this line gave lots of errors! Presumably we're using this in quite a few places.
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.
@nalimilan Can you explain? The docs on constructors seems to suggest that Symbol(a)
and convert(Symbol, a)
should be equivalent. By default the constructor is defined in terms of convert
, but in this case the implementation (that I could not find) seems to be in the constructor.
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.
Sorry, I meant that we usually define convert
and let the default constructor fall back to it, rather than the reverse. But in this case that seems to make sense.
From comments by stevengj in JuliaLang#15995.
From comments by stevengj in JuliaLang#15995.
From comments by stevengj in JuliaLang#15995.
From comments by stevengj in JuliaLang#15995.
symbol(s::ASCIIString) = symbol(s.data) | ||
symbol(s::UTF8String) = symbol(s.data) | ||
symbol(a::Array{UInt8,1}) = | ||
Symbol(s::Symbol) = s |
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.
OTOH this constructor is probably useless due to the fallback to convert
.
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.
Is this what's causing the method error(s) @tkelman noticed?
...but like I say removing the convert kills the build. :/
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.
As @nalimilan said, the default constructor calls convert
, not the other way around, so if you remove something it should be the constructor(s).
This renaming follows Julia's capitalization of named Types and their constructors.
This pull request should reflect edits to deprecate.jl and expr.jl.