Expand and show_sexpr are handy!
Looks like you were right, Tamas.

On Saturday, March 14, 2015 at 12:33:56 PM UTC, John wrote:
>
> I was surprised today that the following function doesn't modify an input 
> array
> function f(x)
>     x += 1
> end
> However, now I understand that x += 1 is just syntactic sugar for x = x + 
> 1.
> The reasoning from https://github.com/JuliaLang/julia/issues/7052 makes 
> sense.
> OTOH, x[:] += 1 does modify the input array.
> But that contradicts my mental model of how the language works, because 
> x[:] == x.
> Is there some special magic going on during parsing?
>
> related: 
> https://groups.google.com/forum/#!searchin/julia-users/inplace/julia-users/fHB7WLiiLsQ/U6dJBqcNLg4J
>
>

Reply via email to