From: 7stud -- Date: 2008-04-19T00:37:47+09:00 Subject: Re: how to change objects in heap? Dmitry Regent wrote: > I'm novice at ruby and faced to a little problem. > > I'll explain on the example: > > I have a few references to an object > > a = A.new > b = a > c = a > d = a > > I want to change object of class A with object of class B here > > if I do > > a = B.new > > b,c,d will be still refer to object A > > How can I do it? a = [10] b = a c = a a[0] = 20 puts b[0] puts c[0] --output:-- 20 20 -- Posted via http://www.ruby-forum.com/.