From: Albert Schlef Date: 2010-04-01T08:06:42+09:00 Subject: Re: each_slice() Albert Schlef wrote: > Anybody has an idea how to rewrite the following code > > some_array.each_slice(2).to_a > > so that it works in Ruby 1.8 too? Problem solved. I eventually wrote this: some_array = [1,2,3,4,5,6] pairs = [] pairs << some_array.shift(2) while !some_array.empty? -- Posted via http://www.ruby-forum.com/.