From: Charles Comstock Date: 2004-06-12T01:23:47+09:00 Subject: Re: Array#rest On 11 Jun 2004, Tom Counsell wrote: > Charles Comstock wrote in message news: > > a = [1,2,3,4] > > a[1..-1] # -> [2,3,4] > > a.rest # -> [2,3,4] > > In what way are you after something different from Array.shift? > > a = [1,2,3,4] > wanted = a.shift # 1 > passed = a # [2,3,4] > > Tom > I don't want a destructive function. A number of times I have used the shift and the remainder, but there are a number of times you want a non destructive copy of the rest of the list. Hence rest ;p Charles Comstock