From: Dave Thomas Date: 2000-12-09T22:52:59+09:00 Subject: [ruby-talk:6963] Re: Accessing an non-existing segment of an array raja@cs.indiana.edu (Raja S.) writes: > My personal experience has been that when I ask for a segment of an > array my intention is: "give me as much as you've got and truncate > the rest". Of course, if that portion itself had nils in it then it > is my responsibility to be able to handle them. > > 0 1 2 3 4 > a = [2,3,5,7,11] > > b = a[3..10] #-> [7,11] I guess my confusion comes from the intent of the code: why would you ever _ask_ for elements outside the bounds of the array? Dave