From: Simon Krahnke Date: 2009-02-07T13:34:20+09:00 Subject: Re: Special Hash Constructors * Robert Klemme (18:05) schrieb: > ha = Hash.new {|h,k| h[k] = []} > Since the idiom is so common, what does everybody think of putting it > into the standard library: Why not def Hash.with(default=nil) new { | h, k | h[k] = default.dup } end > While we're at it, we might as well add > > def Hash.with_hashes > new {|h,k| h[k] = Hash.new(&h.default_proc)} > end I'm too tired for that. Does that create Hash with a default proc that is the same as the one you specify right there? mfg, simon .... l