# Re: str1 = str2 is not a copy?!?

**URL:** <https://www.ruby-forum.com/t/re-str1-str2-is-not-a-copy/74791>\
**Category:** Ruby\
**Created:** [November 7, 2006, 10:56am UTC](https://www.ruby-forum.com/t/re-str1-str2-is-not-a-copy/74791 "2006-11-07T10:56:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [November 7, 2006, 10:56am UTC](https://www.ruby-forum.com/t/re-str1-str2-is-not-a-copy/74791/1 "2006-11-07T10:56:32Z")

</div>

From: Louis J Scoras [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]

> On 11/2/06, Gavin K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > The thing to wrap your head around here is that ‘slots’ in  
> > an Array, and  
> > the values in Hash objects, are very much like variables.  
> > They point to  
> > values, they do not contain them.
> 
> Of course. I’m just pointing out how this could be confusing to  
> someone who is new to ruby. Same sort of thing with the other thread  
> floating around about mutator methods.

Yup. To be clear, my response was not an attempt to ‘correct’ you, but  
rather to help form a good mental model for anyone who might not be  
clear what was going on in your example.

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [November 7, 2006, 10:56am UTC](https://www.ruby-forum.com/t/re-str1-str2-is-not-a-copy/74791/2 "2006-11-07T10:56:34Z")

</div>

On 11/2/06, Gavin K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Yup. To be clear, my response was not an attempt to ‘correct’ you, but  
> rather to help form a good mental model for anyone who might not be  
> clear what was going on in your example.

Absolutely. Your explanation was excellent, as always. What I meant  
was, although it may seem quirky at first, eventually the realization  
comes that it’s better this way.

One only has to try out writing some C code for a while to see what  
they’re missing =)
