From: Hal Fulton Date: 2004-01-15T05:55:59+09:00 Subject: Re: Getting the tail of a list? Dave Brown wrote: > In article <20040114130426.GA15734@mlabdial.hit.bme.hu>, > KONTRA Gergely wrote: > : On 0113, Robert Klemme wrote: > : > > Whups, never mind, that doesn't work. :) > : > > : > But this does: > : > > : > irb(main):001:0> a=[1,2,3,4] > : > => [1, 2, 3, 4] > : > irb(main):002:0> a[1,a.length] > : > => [2, 3, 4] > : > > : > The second parameter is the length. Simply using a.length is sufficient > : > since then all elements to the end are used. > : > : I _would like to_ write a[2,Infinity], or something like that... > > a[1,-1] :) "Error: Cycle detected in ruby-talk thread" Read again. Robert's point was that this doesn't work. The second parameter is a length, and a length of -1 gives you nil. Hal