From: Hal Fulton Date: 2006-08-25T08:08:55+09:00 Subject: Re: That's Ruby, Virginia! Henry Savr wrote: > Well, you wrote a great Array Analyzer > Here it is: > > def array_101 > for i in [0 ... self.length] > puts "#{i} => #{self[i]}" > end > end > > And prepared the following array for test: > > a = ['a','s','d'] > > What do you think, it will print? > > Yeeees, you are right. > And the answer is... > > 0...3 => asd :) Well, it did exactly what you said it should do. It iterated over the contents of the array [0...self.length] (which has only one element, the range 0...self.length). Cheers, Hal