From: Joel VanderWerf Date: 2006-02-03T08:34:27+09:00 Subject: Re: Seeking the Ruby way Jacob Fugal wrote: > sum = Hash::new{|h,k| h[k] = 0} And for some reason, I tend to write sum = Hash.new(0) when dealing with an immediate value. (But maybe it's a better practice to use Ara's form, so that if you ever replace 0 with, say, a matrix, you don't reuse the same object for each key in the hash.) -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407