From: Robert Klemme Date: 2008-02-05T03:24:56+09:00 Subject: Re: convert array to array-of-arrays? On 04.02.2008 17:32, Phlip wrote: > Robert Klemme wrote: > >> irb(main):001:0> [1, 2, 3, 4].to_enum(:each_slice, 2).to_a > > Thanks! Now, for those of us mired in the doldrums of Ruby 1.8.x, how to > write to_enum in Ruby? I found each_slice, and I know C and ruby.h, but > my Ruby internals are rusty... AFAIK it is in *all* Ruby 1.8.* versions. You just need an extra "require" (see my first posting in this thread). Cheers robert