>n ndrop >c c>
continue continue-with
stop suspend (spawn)
- ! Don't step into some sequence words since output of
- ! (string) and new-sequence-unsafe may not print due to
- ! memory safety issues
- <sbuf> prepare-subseq subseq new-sequence-unsafe
} [
dup [ execute break ] curry
"step-into" set-word-prop
{ "<wrapper>" "kernel" }
{ "(clone)" "kernel" }
{ "<string>" "strings" }
- { "(string)" "strings.private" }
{ "array>quotation" "quotations.private" }
{ "quotation-xt" "quotations" }
{ "<tuple>" "classes.tuple.private" }
{ underlying string }
{ length array-capacity } ;
-: <sbuf> ( n -- sbuf ) (string) 0 sbuf boa ; inline
+: <sbuf> ( n -- sbuf ) 0 <string> 0 sbuf boa ; inline
M: sbuf set-nth-unsafe
[ >fixnum ] [ >fixnum ] [ underlying>> ] tri* set-string-nth ;
! Unsafe sequence protocol for inner loops
GENERIC: nth-unsafe ( n seq -- elt ) flushable
GENERIC: set-nth-unsafe ( elt n seq -- )
-GENERIC: new-sequence-unsafe ( len seq -- newseq ) flushable
M: sequence nth bounds-check nth-unsafe ;
M: sequence set-nth bounds-check set-nth-unsafe ;
M: sequence nth-unsafe nth ;
M: sequence set-nth-unsafe set-nth ;
-M: sequence new-sequence-unsafe new-sequence ;
-
! The f object supports the sequence protocol trivially
M: f length drop 0 ;
M: f nth-unsafe nip ;
: prepare-subseq ( from to seq -- dst i src j n )
#! The check-length call forces partial dispatch
- [ [ swap - ] dip new-sequence-unsafe dup 0 ] 3keep
+ [ [ swap - ] dip new-sequence dup 0 ] 3keep
-rot drop roll length check-length ; inline
: check-copy ( src n dst -- )