Slava,

((copy)) is scary:

: ((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

It's only used by (copy):

: (copy) ( dst i src j n -- dst )
    dup 0 <= [ 2drop 2drop ] [ 1- ((copy)) (copy) ] if ; inline

((copy)) preserves it's arguments. If you change it so that it doesn't, it 
becomes:

: ((copy)) ( dst i src j n -- )
    dup -roll + swap nth-unsafe -roll + swap set-nth-unsafe ;

Which is a little better.

The thing is, now (copy) has to preserve the 5 arguments and ... 5dup isn't in 
the core. (copy) would like this:

: (copy) ( dst i src j n -- dst )
    dup 0 <= [ 2drop 2drop ] [ 1- 5dup ((copy)) (copy) ] if ; inline

These versions pass the sequences tests.

Ed

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to