From: Alex Gutteridge Date: 2008-07-15T23:07:48+09:00 Subject: Re: array ending syntax question On 15 Jul 2008, at 06:13, Roger Pack wrote: > irb(main):001:0> [1,2][2..2] > => [] > irb(main):002:0> [1,2][3..3] > => nil > > > Is this expected? > the ri says: > Returns nil if the index (or starting index) are out of range. > > does the first example match this? > Thanks! > -R From the Pickaxe: If the start index equals the array size and a length or range (as here) parameter is given, an empty array is returned. Not sure why you would want that behaviour though... Alex Gutteridge Department of Biochemistry University of Cambridge