From: Hassan Schroeder Date: 2010-12-20T03:23:02+09:00 Subject: Re: Arrays and Lists ? On Sun, Dec 19, 2010 at 10:01 AM, Emil Macarie wrote: >  I do see the Array class has an insert method, however assuming that > the implementation of an Array is actually a contiguous array in memory, > the insert method will create a new copy of an array with the insert > element appended. >  That means that if I want to start with an empty list and insert > 10,000 elements, 10,000 arrays will be created out of which I would only > care about the final one. Forgive me if I'm misunderstanding your point, but -- >> things = Array.new => [] >> things.object_id => 2163798080 >> things << Object.new => [#] >> things => [#] >> things.object_id => 2163798080 >> No new Array is being created by adding an element to the Array. -- Hassan Schroeder ------------------------ hassan.schroeder@gmail.com twitter: @hassan