From: Pit Capitain Date: 2009-02-08T00:37:13+09:00 Subject: Re: Special Hash Constructors 2009/2/7 Tom Link : > Not so good: > TypeError: can't dup Fixnum I often use class Hash def self.new_with new { |h, k| h[k] = yield } end end Hash.new_with { [] } which works with Arrays and Fixnums, though it isn't needed for the latter. Regards, Pit