From: "Simon Kröger" Date: 2007-09-18T05:10:06+09:00 Subject: Re: group array elements in groups of two Yukihiro Matsumoto wrote: > Hi, > > In message "Re: group array elements in groups of two" > on Tue, 18 Sep 2007 01:10:10 +0900, William James writes: > > |Nirvana at last! I won a round of golf with > |Matz! > | > |YM: .to_enum(:each_slice, 2).to_a > |WJ: .enum_slice(2).to_a > > Well done, but your version does not work on 1.8. ;-) > > matz. Will the world stop turning or am i just trapped in a parallel universe? $ ruby -v -renumerator -e "p [1,2,3,4,5,6,7,8,9,0].enum_slice(2).to_a" ruby 1.8.4 (2005-12-24) [i386-cygwin] [[1, 2], [3, 4], [5, 6], [7, 8], [9, 0]] cheers Simon