From: dblack@... Date: 2006-01-26T11:13:51+09:00 Subject: Re: simple newbie question Hi -- On Thu, 26 Jan 2006, kieran kirwan wrote: > Hi, > I have a piece of code below in which I; > 1.....make a new NumberList object and append two MyNumber objects. > 2.....copy the NumberList object and append a further MyNumber object. > However after this both objects are the same. [...] > zl2=zl1 That's why they're the same: by doing this assignment, you're storing a new reference to the object in zl2. But it's still the same object. David -- David A. Black dblack@wobblini.net "Ruby for Rails", from Manning Publications, coming May 1, 2006! http://www.manning.com/books/black