From: Colin Bartlett Date: 2010-08-24T20:18:47+09:00 Subject: Re: assert "foo"[3] != "foo"[3,1]...revisited --0016e64c1dc22ba419048e8fedea Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Correcting my own post to remove confusion between length as in array.size and length as in slice(index, length) Element Reference=97Returns the element at index, or returns a subarray starting at start and continuing for length elements, or returns a subarray specified by range. Negative indices count backward from the end of the array (-1 is the last element). /*new line to highlight that an out of range index might not return nil*/ Returns nil if the start (or starting index) are out of range: /* suggested additional documentation */ /*new line*/ *unless* there is a length *and* Integer(start) =3D=3D array.s= ize; /*new line*/ *or* the argument is a range *and* Integer(range.begin) =3D=3D array.size. /*new line*/ For these special cases (see the table of examples) the return value is an empty array []. /*new line*/ The reason for this special behaviour is that when the start i= s within the array the sought length is rounded /* or use "truncated"? */ to fit in the size. In the special cases examples 5 (which is the size of the array) is considered as touching the end of the array, so the returned valu= e is a subarray with size zero. --0016e64c1dc22ba419048e8fedea--