Add sequences.lib.replicate

db4
Eric Mertens 2008-04-22 23:45:30 -07:00
parent 6a0dc9f024
commit f9659ecc7c
1 changed files with 4 additions and 0 deletions
extra/sequences/lib

View File

@ -131,6 +131,10 @@ MACRO: firstn ( n -- )
[ find drop [ head-slice ] when* ] curry
[ dup ] swap compose keep like ;
: replicate ( seq quot -- newseq )
#! quot: ( -- obj )
[ drop ] swap compose map ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<PRIVATE