From: Luc Traonmilin Date: 2009-03-14T23:38:21+09:00 Subject: Re: How do arrays in Ruby work? --00504502c97a48966404651533b7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit slice only returns the value within the range or at index but does not modify the original array. slice![1] would effectively remove value at index 1 from arr. I don't know how it is implemented. On Sat, Mar 14, 2009 at 3:12 PM, Peter Wu wrote: > As in how they are organized behind the scenes. > > For example, if I say > > arr = [1, 2, 3, 4] > arr.slice[1] > > Is it going to have to physically relocate everything after 2 in memory? > Would using a linked list be more efficient if a lot of elements are > going to be removed and inserted? > -- > Posted via http://www.ruby-forum.com/. > > -- Luc Traonmilin --00504502c97a48966404651533b7--