From: Phlip Date: 2009-03-09T02:08:55+09:00 Subject: Re: how to un-ragged a 2D array? lasitha wrote: > needs.map {|x, y| [x, y ||= x] } You win! But try just: needs.map{|x, y| [x, y || x] } (And would needs.map{|*x| [*x, *x].first(2) } work on Ruby 1.9? 1.8.7?) However, I ain't gonna edit my gist just to put it in - you missed the deadline! (-: http://gist.github.com/75525 -- Phlip