From: Andrew Walrond Date: 2003-06-12T23:02:17+09:00 Subject: Re: does each work on a copy? Rasputin wrote: > This has me confused (It's getting to be a frequent experience). > > ----------------8<---------------- > > SPACE = 1 > > a = Array.new(5) > b = Array.new(5, SPACE) > > a.each { |el| > el = SPACE > } > el is simply a reference to the array element. by el = SPACE simply makes el refer to SPACE instead; it has no effect on the array element remember that pretty much everything is a reference and you won't go far wrong Andrew Walrond