> `each_with_object` isn't specific to hashes, and isn't doing list
translation like `map` does.

I think `each_with_hash` would be really useful. Not only for cases where
you would normally use `each_with_object({})`, but it would also be much
nicer to write `each_with_hash([])` instead of
`each_with_object(Hash.new([]))`.

I had another idea that I'd like to mention: Since you'd often be using
default hash values with `each_with_hash`, I would find it useful if there
was an easy way to convert the default value into a proc that sets the hash
value when a key is looked up, instead of writing  `-> hash, key {
hash[key] = <default> }`.
My intention is to be able to write code like: `[1, 2,
1].each_with_hash([], true) {|h, v| h[v] << v ** 2 }`, where the `true` arg
would convert the default value into the proc above. (Personal preference,
but I don't really like `+= []`). Does anyone else think that could be
useful?


> IOW, it sounds perfect for ActiveSupport. ;-)

Let me know if you think `each_with_hash` is a good idea, and if it should
be added to ActiveSupport. I could open a pull request on Rails or start a
new Issue for Ruby :)


Best,
Nathan