matz, and I, and matz: > |> I think > |> > |> Hash.new{...} > |> > |> is the way to go. > | > |I agree. But should we have way to change the hash default > |initializer? > > Not really. I appreciate your view. But it would be even easier if you explain it a little bit more, like giving an example why it's not needed or not wanted. This seems a bit tedious h = Hash.new { "foo" } stuff_data_to_hash(h) h = Hash.new { "bar" }.replace h # seems a bit tedious stuff_some_more_data_with_different_default_initializer(h) I guess I like h.set_default_initializer { "bar" } more than data transfer between hashes. > Hash default value (single object given to `Hash::new') > and hash fallback (block given to `Hash::new') are two similar yet > different beasts. I see. Actually this is the reason why I named the block form to be default initializer instead of default value. > And code portion by block may not be replaceable > later in many other cases. Would you like to elaborate a little. - Aleksi