Description
openedon Jul 12, 2013
I would prefer that range indexing of an Array
(e.g. X[1:10, :]
) created a SubArray
(a view/reference), not a copy. This seems more in the spirit of Julia's pass-by-reference semantics, and would eliminate some of the performance gotchas with range indexing.
It might also make future loop-devectorization optimization easier, because subarray references can be devectorized back into references to the original array without worrying that you will be changing the semantics.
It would reduce Matlab compatibility, but we already do that with pass-by-reference and so I doubt many users will be surprised by having the same reference semantics for range indexing.
This is something that has come up informally several times on the mailing list, but I didn't see any issue for it.