From: Tanaka Akira Date: 2010-12-18T14:36:52+09:00 Subject: [ruby-core:33766] Re: [feature:trunk] Enumerable#categorize 2010/12/16 Run Paint Run Run : > 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. #chunk and #slice_before collects adjasent elements in enumerable. #group_by and #categorize collects elements from all elements in enumerable. #categorize is more general than #group_by. It can specify hash values. -- Tanaka Akira