From: Run Paint Run Run Date: 2010-12-16T03:01:23+09:00 Subject: [ruby-core:33731] Re: [feature:trunk] Enumerable#categorize > pp ary.categorize {|e| [e[1], e[0]] } > #=> > {"Yukihiro Matsumoto"=>["matz"], > "Nobuyoshi Nakada"=>["nobu"], > "Tanaka Akira"=>["akr"], > "Usaku NAKAMURA"=>["usa"], > "NARUSE, Yui"=>["naruse"], > "SASADA Koichi"=>["ko1"]} ary.map.with_object({}){|e,h| h[e[1]] = [e[0]]} => {"Yukihiro Matsumoto"=>["matz"], "Nobuyoshi Nakada"=>["nobu"], "Tanaka Akira"=>["akr"], "Usaku NAKAMURA"=>["usa"], "NARUSE, Yui"=>["naruse"], "SASADA Koichi"=>["ko1"]} We currently have #chunk, #group_by--so to some extent #partition--and #slice_before for segregating an Enumerable into an Enumerable of Enumerables. I understand their difference on paper, but still need to experiment with them in IRB before use. This proposal would add two more methods to this list--#categorize and matz's alternative--for what appear to be increasingly specialised uses. I'm unconvinced.