From: Ralph Mason Date: 2001-12-24T10:22:56+09:00 Subject: [ruby-talk:29388] Re: a better way? From: "Ron Jeffries" > > >Or in recent 1.7.2, > > > > class Temp > > @@save = Hash.new do |h, c| > > puts "Performing calculation...." > > h[c] = c * 9 / 5 + 32 > > end > > def fahrenheit(c) > > @@save[c] > > end > > end > > These are way cool. I gather the 1.7.2 feature is new? I think I'm in > 1.6 and it doesn't work there. This does lead me to think that there is a surprise here. Notably that a function that does not expect a block will happily accept one and not make any noise about it. It would be nice to get some warning, e.g. : Hash.new() - block supplied but not used Ralph