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

Deprecate symbol (to Symbol) #16154

Merged
merged 3 commits into from
May 2, 2016
Merged

Deprecate symbol (to Symbol) #16154

merged 3 commits into from
May 2, 2016

Conversation

hayd
Copy link
Member

@hayd hayd commented May 1, 2016

Originally #15995 (and #16130 #16037 #16038 #16150).

In the second commit I address stevengj's comments from the original PR. Hopefully it'll pass the tests...

@@ -489,14 +489,14 @@ end
for T in indexes.parameters
T <: CartesianIndex ? (M += length(T)) : (M += 1)
end
index_length_expr = index <: Colon ? Symbol(string("Istride_", N+1)) : :(length(index))
index_length_expr = index <: Colon ? Symbol("Istride_", N+1) : :(length(index))
Copy link
Member Author

Choose a reason for hiding this comment

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

Ah damn, this'll probably fail.

Copy link
Contributor

Choose a reason for hiding this comment

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

also best not to at-notify users in commit messages, otherwise every time this gets rebased they will get a notification

Copy link
Member Author

Choose a reason for hiding this comment

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

Good to know, will change the message when I rebase. Er, why is this "outdated" already?!

Copy link
Member Author

Choose a reason for hiding this comment

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

I take it back, the above should work. Do you want me to amend the commit message (to remove the mistyped stevengj's at handle)?

@@ -67,7 +67,7 @@ end
(-)(y::Period,x::TimeType) = x - y

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

Choose a reason for hiding this comment

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

I think this actually can be 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.

not if we add any other operators to the for loop

@hayd hayd force-pushed the pr16130 branch 2 times, most recently from b793476 to df832b7 Compare May 1, 2016 22:24
@hayd hayd changed the title Deprecate Symbol Deprecate symbol (to Symbol) May 1, 2016
@@ -144,13 +144,13 @@ representations together:

Copy link
Contributor

Choose a reason for hiding this comment

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

Missed the rename of :func:symbol`` here. It might also be more intuitive to rewrite it and call it the Symbol constructor rather than a regular function.

Copy link
Member Author

@hayd hayd May 2, 2016

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 was here before, so let's patch that up after :)

@hayd
Copy link
Member Author

hayd commented May 2, 2016

Since this has already had several rounds of comments I'm going to merge this.

Thanks @jeffreysarnoff-dev / @JeffreySarnoff !

@@ -1082,6 +1082,9 @@ end
@deprecate sprand{T}(n::Integer, density::AbstractFloat, ::Type{T}) sprand(T, n, density)
@deprecate sprand{T}(r::AbstractRNG, n::Integer, density::AbstractFloat, ::Type{T}) sprand(r, T, n, density)

#16130
Copy link
Member

Choose a reason for hiding this comment

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

wrong PR #

Copy link
Member Author

Choose a reason for hiding this comment

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

ha, that's one of the numbers... we should use the original.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed, thanks!

@hayd hayd merged commit 5c4058e into JuliaLang:master May 2, 2016
@hayd hayd deleted the pr16130 branch May 2, 2016 03:12
@@ -67,7 +67,7 @@ end
(-)(y::Period,x::TimeType) = x - y

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.

this should really not be combined with renaming

Copy link
Member Author

@hayd hayd May 2, 2016

Choose a reason for hiding this comment

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

It's in the second, cleanup, commit.

Edit: That is, the right hand side of this line diff is in the second commit (removing :end). The symbol -> Symbol is in the first commit.

Copy link
Contributor

Choose a reason for hiding this comment

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

there are multi character dot operators that this loop may want to be extended to, I think this change is unnecessary and could make this bug prone later

@tkelman
Copy link
Contributor

tkelman commented May 2, 2016

this caused several method overwrite warnings

@nalimilan
Copy link
Member

While you're at it, would you be willing to add the new Symbol methods (i.e. those which were previously symbol) to Compat.jl?

@Keno
Copy link
Member

Keno commented May 2, 2016

Yes, this urgently needs Compat definitions.

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.

7 participants