David A. Black wrote:
> Hi --
>
> On Tue, 10 Feb 2009, Julian Leviston wrote:
> > Slices and 'sub-arrays' aren't copies of the objects, they simply refer
> > to the identical objects.
>
> The same can be said of any array; the objects inside it exist (in
> many cases, at least) already. Still, container objects do take up
> memory.

Ruby arrays are copy-on-write though. So subarray = my_array[100...1000100] 
does *not* take up any memory except for the additional array object (which 
will contain a pointer to the 100th item of my_array and the length 1000000).

HTH,
Sebastian
-- 
Jabber: sepp2k / jabber.org
ICQ: 205544826