Skip to content
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

#16038 deprecate symbol ==> Symbol #16038

Closed
wants to merge 4 commits into from
Closed

#16038 deprecate symbol ==> Symbol #16038

wants to merge 4 commits into from

Conversation

jeffreysarnoff-dev
Copy link

deprecate symbol ==> Symbol (first commit)
minor fixups relating to symbol(string("..")) (second commit)

@jeffreysarnoff-dev
Copy link
Author

replaces pull request #15995, wait for the second commit here.

@jeffreysarnoff-dev
Copy link
Author

Second commit complete, more likely than not: it is good to go.

@nalimilan
Copy link
Member

Thanks, looks good (though you could have changed all occurrences of string(op)[2:end]).

@stevengj
Copy link
Member

(In general, it is better to do a forced push rather than opening a new PR, so that all the discussion goes into a single PR.)

@Jeffrey-Sarnoff
Copy link

@stevengj with practice [till then, the link exists]
I am content should this work.

ccall(:jl_symbol_n, Ref{Symbol}, (Ptr{UInt8}, Int32), a, length(a))
symbol(x...) = symbol(string(x...))
Symbol(x...) = Symbol(string(x...))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test failures come from this: a test in replutil.jl:227 expects Symbol() to throw a MethodError (#14884), and with this change it returns Symbol(""). I'd say we should just remove the test, but that part of the code is quite obscure.

@vtjnash @tkelman What's the best solution here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this code replaces that test (which was testing that adding methods to Symbol worked correctly)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, there is nothing for me to do? (he asks hopefully)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vtjnash can confirm whether that's what he meant, but at the minimum you should change the test I referred to. For example, replace Symbol with sum() (be sure to change the error message check too).

Then, please squash the changes into 2 commits. You can do that using git rebase -i master, reordering the commits as needed, and then writing squash for those you want to merge with the preceding commit. Then, do git push jeffreysarnoff-dev +jas/deprecate_symbol to update the PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was never done?

nalimilan pushed a commit that referenced this pull request Apr 25, 2016
@jeffreysarnoff-dev
Copy link
Author

There was one fixup missed in threadcall.jl. That is fixed, it may be a separate commit. The only case of [2:end] that I did not change should not be changed afaik.

@@ -229,7 +229,7 @@ GeneralPeriod = Union{Period,CompoundPeriod}
(+){P<:GeneralPeriod}(x::StridedArray{P}) = x

for op in (:.+, :.-)
op_ = symbol(string(op)[2:end])
op_ = Symbol(string(op)[2])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is right

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct, the edit is undone.

@jeffreysarnoff-dev
Copy link
Author

Is there anything I can to do to make this ready? If the stuff in the second commit reveals other issues, should I adjust this so that only the first commit is present, leaving the second commit to some other PR?

@stevengj
Copy link
Member

You'll want to merge the last three commits (via git rebase -i HEAD~4 followed by a forced push) so that you only have two commits: one for the deprecation and one for the cleanup.

You'll also need to rebase against master to fix the conflicts.

And finally, the tests are failing with err not defined, so you'll need to fix that.

@jeffreysarnoff-dev
Copy link
Author

@stevengj I don't know how to do that. I know how to change this so that it only does symbol(x...) ==> Symbol. And I know how to say "I don't know how to do that."

@stevengj
Copy link
Member

@jeffreysarnoff-dev
Copy link
Author

trying anyway

@nalimilan
Copy link
Member

See also my detailed instructions at #16038 (comment).

But note that the fix for the failing tests will have to go into the first commit, so that it doesn't break the build.

@jeffreysarnoff-dev
Copy link
Author

I may have "You'll want to merge the last three commits (via git rebase -i HEAD~4 followed by a forced push) so that you only have two commits: one for the deprecation and one for the cleanup. You'll also need to rebase against master to fix the conflicts."

In the event that that went as intended, and the fix is to eliminate the test (or, just avoid the conflict), How do I put that into the first commit?

@nalimilan
Copy link
Member

Commit the change, do git rebase -i master, move the commit with the tests fix to the line below your first commit, mark it as squash. Then you need to force-push again.

Note your last push removed your commits and added unrelated ones...

@jeffreysarnoff-dev
Copy link
Author

Thank you for the help -- whatever I did did not make the repository as it should be,
even though I did the rebasing and forced push. I will revisit this tonight. There are two different things in this PR now, and the original intent works; the second part, replacing Symbol(string(a),...) with Symbol(a,...) is where the conflicts happen and where my lack of familiarity with (or trust in) git complicates this. I will reread the guidance and retry for both, if it not work -- I am going to provide jas/deprecate_symbol as current with julia + 1 commit.

@nalimilan
Copy link
Member

If you can make this PR pass the tests with only the first part, that's OK. Then you'll be able to open a new PR for the improvements.

@jeffreysarnoff-dev
Copy link
Author

updated to a single commit just replacing symbol with Symbol in .jl, .md, .rst
and keeping _symbol as _symbol
https://github.com/jeffreysarnoff-dev/julia/tree/jas/deprecate_symbol

@jeffreysarnoff-dev
Copy link
Author

replaced by clean version PR 16130

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants