Re: simple question: pointer equivalent in ruby
- From: "David A. Black" <dblack@xxxxxxxxxxx>
- Date: Sun, 17 Oct 2010 11:25:51 -0500
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
.
- Follow-Ups:
- Re: simple question: pointer equivalent in ruby
- From: Parker Selbert
- Re: simple question: pointer equivalent in ruby
- References:
- simple question: pointer equivalent in ruby
- From: Shea Barton
- Re: simple question: pointer equivalent in ruby
- From: Parker Selbert
- simple question: pointer equivalent in ruby
- Prev by Date: Re: simple question: pointer equivalent in ruby
- Next by Date: Re: github: maintain multiple releases of a gem
- Previous by thread: Re: simple question: pointer equivalent in ruby
- Next by thread: Re: simple question: pointer equivalent in ruby
- Index(es):