From: Aldric Giacomoni Date: 2009-11-05T21:27:24+09:00 Subject: Re: Odd : a = Hash.new(Hash.new) Robert Klemme wrote: > 2009/11/5 Jes�s Gabriel y Gal�n : >>>> Robert - I agree. I like this one better. Feels a little more ruby-ish. >>>> instead of triggering the proc. >> Maybe this is his use case? > If I wanted to save typing I'd place the whole construction in a method > > def cnh # silly name "create nested hash" > Hash.new {|h,k| h[k] = Hash.new(&h.default_proc)} > end > > a = cnh > b = cnh > c = cnh > d = cnh > > Kind regards > > robert Oh sure - be lazier than me. I see how it is. :-) Thanks - Jesus was right.. I was trying to be lazy. -- Posted via http://www.ruby-forum.com/.