diff --git a/extra/newfx/newfx.factor b/extra/newfx/newfx.factor index 9cc63fd57e..825c70001e 100644 --- a/extra/newfx/newfx.factor +++ b/extra/newfx/newfx.factor @@ -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 ; \ No newline at end of file +: 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 ;