newfx: purge and purge!

db4
Eduardo Cavazos 2008-07-11 11:56:05 -05:00
parent 62b1ebb33d
commit 698a66d076
1 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,5 @@
USING: kernel sequences assocs qualified circular sets ;
USING: kernel sequences assocs qualified circular sets fry sequences.lib ;
USING: math multi-methods ;
@ -242,4 +242,11 @@ METHOD: as-mutate { object object assoc } set-at ;
: insert ( seq i obj -- seq ) >r cut r> prefix append ;
: splice ( seq i seq -- seq ) >r cut r> prepend append ;
: splice ( seq i seq -- seq ) >r cut r> prepend append ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: purge ( seq quot -- seq ) [ not ] compose filter ;
: purge! ( seq quot -- seq )
dupd '[ swap @ [ pluck! ] [ drop ] if ] each-index ;