x = ['a'] setindex!(x, 'b', 1) # ['b'] x = 'c' # 'c'
This behaviour is documented:
a[i,j,...] = xis converted by the compiler to
(setindex!(a, x, i, j, ...); x).
(The documentation seems silent on the return value of
I have two questions:
- main question: Why does indexed assignment return the assigned value?
side question: Why does
setindex!return the container instead?