From: martindemello@... (Martin DeMello) Date: 2002-10-21T07:51:58+09:00 Subject: Grouping by twos Another of those trivial little problems that I obsess about finding the Proper way to do - what's a nice, idiomatic Ruby way to go from [a,b,c,d.....] to [[a,b],[c,d],[e,f],...]? Note that I want to preserve the ordering, so to_hash won't work. One way I thought of was b = [] while a[0] do b << [a.shift, a.shift] end which works but doesn't look particularly elegant. martin