They are actually indistinguishable. There’s no observable difference between them, it’s just that the dotted version involves broadcasting, but in the end it amounts to the same thing.
Both expressions are not what I need.
Probably my bad.
The original v vector must not be mutated.
So first make a copy and then mutate the copy.
Have a look at my working example.
Plus v[inds]=vals return vals which is bad for one-liners. I would like it to return the mutated copy of v.
I think the scenarios could be quite a few.
I just have an original vector and I want get another one with just some replaced values based on index.
There is replace and replace! but these work in the value level.
Yes, this was clear. You were requesting both an in-place and an out-of-place version, so it was implied that you had to copy for the out-of-place version.
Then it seems like Accessors.@set is the way to go, or making your own.