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

.= assignment #285

Closed
stevengj opened this issue Oct 6, 2016 · 4 comments · Fixed by #292
Closed

.= assignment #285

stevengj opened this issue Oct 6, 2016 · 4 comments · Fixed by #292

Comments

@stevengj
Copy link
Member

stevengj commented Oct 6, 2016

0.5 introduced x .= y etcetera for in-place assignment. It would be nice if @compat would translate this to copy!(x, y) in Julia 0.4.

Note that x[...] .= y should become x[...] = y.

Similarly for .+= and so on.

@stevengj
Copy link
Member Author

stevengj commented Oct 6, 2016

(In 0.4, .= is parsed as a comparison.)

@TotalVerb
Copy link
Contributor

Isn't the precedence wrong?

@stevengj
Copy link
Member Author

stevengj commented Oct 6, 2016

Yes. But in most practical circumstances it shouldn't matter, I think, since comparisons have lower precedence than arithmetic.

@stevengj
Copy link
Member Author

stevengj commented Oct 6, 2016

And at worst, people needing 0.4 compatibility can add parens around the rhs.

stevengj added a commit that referenced this issue Dec 22, 2016
stevengj added a commit that referenced this issue Dec 22, 2016
stevengj added a commit that referenced this issue Dec 22, 2016
dpsanders pushed a commit to dpsanders/Compat.jl that referenced this issue Feb 1, 2017
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 a pull request may close this issue.

2 participants