From: Dave Burt Date: 2006-12-07T23:15:11+09:00 Subject: Re: [GOLF]: partitioning an array Martin DeMello wrote: > On 12/7/06, Robert Klemme wrote: >> Hash.new {|h,k| h[k]=[]} > > This is common enough that it deserves to be its own constructor, imo > - Hash.multi perhaps Would you want one of these, too? class Hash def self.new_nested f = proc {|h, k| h[k] = new(&f) } new(&f) end end Cheers, Dave