From: Pit Capitain Date: 2006-03-23T17:45:05+09:00 Subject: Re: questions/suggestions from a Ruby newbie dblack@wobblini.net schrieb: > This reminds me of my favorite way to create an pseudo-auto-vivifying > hash: > > Hash.new {|h,k| h[k] = h.dup } > > :-) I don't think there's an equally concise way for the array thing. David, is this really working for you? x = Hash.new {|h,k| h[k] = h.dup } x[1] = "x1" x[2] p x # => {1=>"x1", 2=>{1=>"x1"}} Maybe you mean Hash.new {|h,k| h[k] = h.dup.clear } Regards, Pit