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

From: Louis J Scoras [mailto:[email protected]]

On 11/2/06, Gavin K. [email protected] 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.

On 11/2/06, Gavin K. [email protected] 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 =)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs