Your example involves two tricky issues: slice behavior and the fact that, despite appearances, A += b is not in-place. See issues #3424, #3217, and precedents they link to.
I'd be interested in hearing more detail about how using slice gets nasty; as you say, from this example slice doesn't look so bad. In trying to fix this, we want to make sure we're aware of all the issues. --Tim On Monday, September 01, 2014 10:02:54 PM Christoph Ortner wrote: > a = rand(3,3,3,3) > b = rand(3,3) > # this works: > a[1,1,:,:] = slice(a,1,1,:,:)+b > # this does not work: > a[1,1,:,:] += b > > This example does not look so bad, but once you use expressive variable > names and more dimensions it quickly gets very nasty. Because of it, I am > doing less vectorisation than I would prefer. > > I know there is a lot of discussion on slicing on the Julia issues list, so > I did not want to post another issue there. > > Is this likely to be resolved in future releases? Are there elegant > alternatives?