Michael Neumann wrote:

> It's even better if you allow customization on the storage (in your case 
> hard-coded to be a Hash):
> 
> module Enumerable
>   def group_by(store=Hash.new)
>     self.each do |elem|
>       group = yield elem
>       (store[group] ||= []) << elem
>     end
>     store
>   end
> end

This is a nice generalization of my original proposal. I like it. If the 
RFE is accepted it would be nice to allow for custom stores.