From: Richard Kilmer Date: 2003-12-04T00:04:01+09:00 Subject: Re: each_with_what_index? On Dec 3, 2003, at 9:50 AM, T. Onoma wrote: > Saying that there's "absolutely nothing unintutive about that" is a > real > stretch. Obviously, I have asked for certain indexes [1..-1], but we > know > that #[ ] is really just a form of slice, so what we get is a new > array, thus > reindexed form [0..a.length-2]. It's understandable, but I sure > wouldn't call > it intuitive. What you did was this: a = [1, 2, 3] b = a[1..-1] b.each_with_index do |t, i| puts "#{t} => #{a[i]}" end You are generating a new array that is a subset of an existing array and then iterating over the new array with the new array's indexes. You then use that index to reference into the original array. Obviously the values would be different.