Paste: group-by

Author: mrjbq7
Mode: factor
Date: Sun, 30 Jan 2011 03:06:48
Plain Text |
: group-by ( seq quot: ( elt -- obj ) -- seq )
    dupd map zip [
        [ first2 ] [ push-at ] bi*
    ] H{ } sequence>assoc ; inline



[ H{ { f V{ 2 2 2 } } { t V{ 1 3 1 } } } ]
[ { 1 2 3 1 2 2 } [ odd? ] group-by ] unit-test

New Annotation

Summary:
Author:
Mode:
Body: