Paste: avoiding gymnastics...

Author: sykopomp
Mode: factor
Date: Fri, 15 Jan 2010 23:11:50
Plain Text |
: split-keys-and-values ( keys-and-values -- values keys ) unzip swap keys ;

: (reduce-results) ( quot-strings keys-and-values -- reductions )
    split-keys-and-values f 
    [ eval( -- quot ) call( keys values rereduce? -- reduction ) ]
    map ;
! what do?

Annotation: .

Author: erg
Mode: factor
Date: Fri, 15 Jan 2010 23:26:46
Plain Text |
{
    { { "foo" "a0oe89ugao0" } 1 }
    { { "bar" "eua90oe8ae" } 1 }
} 
{ "[ 3drop 1 ]" "[ drop nip [ + ] reduce ]" }
[ unzip swap keys ] dip [ eval( -- quot ) call( k v r -- red ) ] 3map

Annotation: ..

Author: erg
Mode: factor
Date: Fri, 15 Jan 2010 23:42:53
Plain Text |
: couchdb-reduce ( assoc quots rereduce? -- seq )
    [ unzip swap keys ] 2dip
    '[ eval( -- quot ) _ call( value key rereduce? -- output ) ] 3map ;

New Annotation

Summary:
Author:
Mode:
Body: