[ tuck nth-unsafe >r nth-unsafe r> ] 3keep tuck
>r >r set-nth-unsafe r> r> set-nth-unsafe ; inline
-: (head) ( seq n -- from to seq ) 0 swap rot ; inline
+: (head) ( seq n -- from to seq ) 0 spin ; inline
: (tail) ( seq n -- from to seq ) over length rot ; inline
: tail* ( seq n -- tailseq ) from-end tail ;
: copy ( src i dst -- )
- pick length >r 3dup check-copy swap rot 0 r>
+ pick length >r 3dup check-copy spin 0 r>
(copy) drop ; inline
M: sequence clone-like
: join ( seq glue -- newseq )
[
- 2dup joined-length over new-resizable -rot swap
+ 2dup joined-length over new-resizable spin
[ dup pick push-all ] [ pick push-all ] interleave drop
] keep like ;