1 USING: compiler kernel math namespaces sequences strings test ;
3 ! http://inferno.bell-labs.com/cm/cs/who/bwk/interps/pap.html
5 : string-step ( n str -- )
7 dup [ "123" % % "456" % % "789" % ] "" make
8 dup dup length 2 /i 0 swap rot subseq
9 swap dup length 2 /i 1+ 1 swap rot subseq append
15 : string-benchmark ( n -- )
16 "abcdef" 10 [ 2dup string-step ] times 2drop ;
18 [ ] [ 400000 string-benchmark ] unit-test