Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Changed meaning of .+= in Julia 0.5 #109

Closed
stevengj opened this issue Jul 21, 2016 · 1 comment
Closed

Changed meaning of .+= in Julia 0.5 #109

stevengj opened this issue Jul 21, 2016 · 1 comment
Assignees

Comments

@stevengj
Copy link

Your code uses x .+= y, so you should know that in Julia 0.5 this has changed meaning to be equivalent to broadcast!(identity, x, x .+ y), so that it mutates the x array (see JuliaLang/julia#17510 … in Julia 0.6 the whole operation will occur in-place without temporaries). So .+ should only be used if the left-hand side is a mutable array, and you don't mind mutating it.

At first glance, it looks like you may need to revise some code. In your process_node function, ref_assign_map is used to rewrite x .+= y to x = x .+ y, whereas in Julia 0.5 this is now x .= x .+ y and mutates the x array.

@DrTodd13 DrTodd13 added this to the Release for Julia 0.5 milestone Aug 2, 2016
@ninegua ninegua self-assigned this Aug 5, 2016
@ninegua
Copy link
Contributor

ninegua commented Aug 8, 2016

Thanks for pointing out this difference. I've provided a fix in latest commit, as well as two test cases.

@ninegua ninegua closed this as completed Aug 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants