From: Daniel Schierbeck Date: 2006-05-22T03:13:21+09:00 Subject: Re: I call Ducktype Violation on #to_proc! :) Dave Burt wrote: > def cached_proc &block > cache = Hash.new {|h, k| h[k] = block.call(*args) } > proc {|*args| cache[args] } > end I think it should be like this though: def cached_proc(&block) cache = Hash.new{|hsh, args| hsh[args] = block.call(*args)} proc{|*args| cache[args]} end Daniel