Re: simple question: pointer equivalent in ruby



Hi --

On Mon, 18 Oct 2010, Parker Selbert wrote:

Shea Barton wrote in post #954956:
OR even

value = 5
othervalue = value
othervalue = 3
value (should be 3)

That is precisely how ruby works by default. If you wanted othervalue to
just take the 'value' of value, i.e. 3, you would use this instead:

value = 5
other = value.dup

Have you tried running that? :-)


David

--
David A. Black, Senior Developer, Cyrus Innovation Inc.

The Ruby training with Black/Brown/McAnally
Compleat Stay tuned for next event!
Rubyist http://www.compleatrubyist.com

.