From: Pit Capitain Date: 2005-06-14T18:48:54+09:00 Subject: Re: finding Hash subsets based on key value Martin DeMello schrieb: >>irb(main):002:0> langs = Set.new([:perl, :python, :ruby]) >>=> # >>irb(main):003:0> langs.classify { |m| m.to_s[0, 1] } >>=> {"p"=>#, "r"=>#} > > That *is* nice - wonder if there'd be any issues with moving it into > Enumerable. Note that Set#classify creates a set for each group, which might not always be what you want. IMO, Enumerable#classify should create arrays instead. Regards, Pit