From: Rob Biedenharn Date: 2011-04-26T03:43:46+09:00 Subject: Re: problem with ruby19's Hash behavior On Apr 25, 2011, at 8:25 AM, Aaron wrote: > Thanks a lot ;) > > kind of clear now, so my code's problem is Hash.new{[]} didn't store > the array object into the Hash > If you want the value stored, you need to do it yourself: [1].inject( Hash.new{|h,k|h[k]=[]} ){ |result, i| result[:mem] << i; result } => {:mem=>[1]} -Rob Rob Biedenharn Rob@AgileConsultingLLC.com http://AgileConsultingLLC.com/ rab@GaslightSoftware.com http://GaslightSoftware.com/