Yeah, it's a pretty tough call. When copying an immutable object in some
sense it should always be fine to just return the original object.


On Thu, Jun 12, 2014 at 10:41 PM, Andre P. <[email protected]> wrote:

> After thinking about this a bit more deeply, it occurred to me that maybe
> this *is* the right behavior.
> After all, this is an immutable type, so I really shouldn't be modifying
> the internal values of array fields anyway.
>
> If this immutable type array field happened to have a massive array
> attached to it,
> it might make sense to have both immutable objects point at that same
> array
> provided that array could not be mutated.
>
> The problem is that one *can* mutate the underlying array and
> undisciplined sods like me go and doing things like the above.
>

Reply via email to