From: Yukihiro Matsumoto Date: 2012-03-19T13:16:06+09:00 Subject: [ruby-core:43461] Re: [ruby-trunk - Feature #4151] Enumerable#categorize Hi, In message "Re: [ruby-core:43432] [ruby-trunk - Feature #4151] Enumerable#categorize" on Sun, 18 Mar 2012 18:48:20 +0900, akr writes: |=begin | Hi. | | How about a method for converting enumerable to hash? | | enum.categorize([opts]) {|elt| [key1, ..., val] } -> hash | | categorizes the elements in _enum_ and returns a hash. The behavior of this method seems complex to me. It reminds me CommonLisp functions. The basic > enum.categorize {|elt| [key1, val] } -> hash is acceptable for me, as generalized version of group_by. Can other features like generating nested hash, seed, update functions be implemented by combining other methods? matz.