From: Len Lawrence Date: 2008-03-22T23:04:53+09:00 Subject: Re: Cloning arrays On Sat, 22 Mar 2008 14:31:51 +0100, Robert Klemme wrote: > On 22.03.2008 14:10, Len Lawrence wrote: >> > A solution would be to do > > e = xygrid['page'].map do |z| > z = z.map { |d| d *= f } > z[2] -= 2.0; z[3] -= 2.0 > z > end > > Or you can do a deep copy via the usual Marshal idiom > > e = Marshal.load(Marshal.dump(xygrid['page'])) > > Kind regards > > robert Thanks Robert. So the issue was fundamental. I had not yet come to appreciate the meaning of 'shallow copy' or come to terms with map or Marshal. The Tk connection here is actually irrelevant. That has been a great help. Len