add accumulator

db4
Doug Coleman 2008-02-01 22:46:32 -06:00
parent db3ac4d75f
commit 004dd0dc5e
1 changed files with 3 additions and 0 deletions
extra/sequences/lib

View File

@ -140,3 +140,6 @@ PRIVATE>
: ?second ( seq -- second/f ) 1 swap ?nth ; inline
: ?third ( seq -- third/f ) 2 swap ?nth ; inline
: ?fourth ( seq -- fourth/f ) 3 swap ?nth ; inline
: accumulator ( quot -- quot vec )
V{ } clone [ [ push ] curry compose ] keep ;