use iota in replicate
parent
679a7c9b01
commit
87a6e9cb31
|
@ -99,10 +99,10 @@ M: f like drop [ f ] when-empty ; inline
|
||||||
INSTANCE: f immutable-sequence
|
INSTANCE: f immutable-sequence
|
||||||
|
|
||||||
! Integers support the sequence protocol
|
! Integers support the sequence protocol
|
||||||
M: integer length ; inline
|
! M: integer length ; inline
|
||||||
M: integer nth-unsafe drop ; inline
|
! M: integer nth-unsafe drop ; inline
|
||||||
|
|
||||||
INSTANCE: integer immutable-sequence
|
! INSTANCE: integer immutable-sequence
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
|
@ -424,9 +424,10 @@ PRIVATE>
|
||||||
over map-as ; inline
|
over map-as ; inline
|
||||||
|
|
||||||
: replicate ( seq quot -- newseq )
|
: replicate ( seq quot -- newseq )
|
||||||
[ drop ] prepose map ; inline
|
[ iota ] dip [ drop ] prepose map ; inline
|
||||||
|
|
||||||
: replicate-as ( seq quot exemplar -- newseq )
|
: replicate-as ( seq quot exemplar -- newseq )
|
||||||
|
[ iota ] 2dip
|
||||||
[ [ drop ] prepose ] dip map-as ; inline
|
[ [ drop ] prepose ] dip map-as ; inline
|
||||||
|
|
||||||
: change-each ( seq quot -- )
|
: change-each ( seq quot -- )
|
||||||
|
|
Loading…
Reference in New Issue