start cleaning up internal implementation of copy (needs more work)

Joe Groff 2009-10-30 00:42:21 -05:00
parent ca8d4c15f4
commit 0f55b8b4c5
1 changed files with 6 additions and 8 deletions

View File

@ -268,18 +268,16 @@ INSTANCE: repetition immutable-sequence
ERROR: integer-length-expected obj ;
: check-length ( n -- n )
#! Ricing.
dup integer? [ integer-length-expected ] unless ; inline
: ((copy)) ( dst i src j n -- dst i src j n )
dup -roll [
+ swap nth-unsafe -roll [
+ swap set-nth-unsafe
] 3keep drop
] 3keep ; inline
: ((copy)) ( dst i src j n -- )
dup -roll + swap nth-unsafe -roll + swap set-nth-unsafe ; inline
: 5bi ( a b c d e x y -- )
bi-curry bi-curry bi-curry bi-curry bi ; inline
: (copy) ( dst i src j n -- dst )
dup 0 <= [ 2drop 2drop ] [ 1 - ((copy)) (copy) ] if ;
dup 0 <= [ 2drop 2drop ] [ 1 - [ ((copy)) ] [ (copy) ] 5bi ] if ;
inline recursive
: prepare-subseq ( from to seq -- dst i src j n )