No, that is not necessarily true. For example, a subarray could point
somewhere inside the array, and most objects don't have a pointer method.

The easiest assumption (which is probably also typically correct) is that
the output of all functions share part of the memory of its inputs.
Therefore, after passing an object into a function, it is generally best to
make a copy if you want to mutate the object. The ! convention
perhaps actually indicates the opposite: after the function call you
maintain full freedom to mutate the input arguments.


On Wednesday, April 23, 2014, Ethan Anderes <ethanande...@gmail.com> wrote:

> Thanks Steven. That helps. So I can infer that no two variables can share
> overlapping memory without their pointers being the same?
>

Reply via email to