From: Mikel Lindsaar Date: 2010-09-13T11:55:57+09:00 Subject: array[index,length] strange behaviour --Apple-Mail-43--1050811364 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi all, Running Ruby 1.8.7. And I saw Jim Weirich's post about the Ruby Koans, = and I thought, what the hey! Lets do them! So I downloaded, and what do you know! I found something I didn't = understand!! :) Anyway, per http://ruby-doc.org/core/classes/Array.html#M002205 it says: = "Returns nil if the index (or starting index) are out of range". So given array: array =3D [:peanut, :butter, :and, :jelly] One would expect: array[4] =3D=3D nil #=3D> true array[5] =3D=3D nil #=3D> true Which works, 4 and 5 are both out of range. However: array[4,0] =3D=3D nil #=3D> false array[5,0] =3D=3D nil #=3D> true Huh? In actual fact array[4,0] returns an empty array. This seems in = conflict with the docs. Can someone more enlightened please explain? Thank you! Mikel --Apple-Mail-43--1050811364--