sequences: adding a subseq-unsafe that doesn't check slice bounds.
parent
16837c56ee
commit
9fad4187f3
|
@ -4,8 +4,8 @@ USING: accessors arrays assocs byte-arrays byte-vectors classes
|
||||||
combinators definitions effects fry generic generic.single
|
combinators definitions effects fry generic generic.single
|
||||||
generic.standard hashtables io.binary io.encodings
|
generic.standard hashtables io.binary io.encodings
|
||||||
io.streams.string kernel kernel.private math math.parser
|
io.streams.string kernel kernel.private math math.parser
|
||||||
namespaces parser sbufs sequences splitting splitting.private
|
namespaces parser sbufs sequences sequences.private splitting
|
||||||
strings vectors words ;
|
splitting.private strings vectors words ;
|
||||||
IN: hints
|
IN: hints
|
||||||
|
|
||||||
GENERIC: specializer-predicate ( spec -- quot )
|
GENERIC: specializer-predicate ( spec -- quot )
|
||||||
|
@ -95,9 +95,10 @@ set-specializer
|
||||||
set-specializer
|
set-specializer
|
||||||
] each
|
] each
|
||||||
|
|
||||||
\ subseq
|
{ subseq subseq-unsafe } [
|
||||||
{ { fixnum fixnum string } { fixnum fixnum array } }
|
{ { fixnum fixnum string } { fixnum fixnum array } }
|
||||||
set-specializer
|
set-specializer
|
||||||
|
] each
|
||||||
|
|
||||||
\ reverse!
|
\ reverse!
|
||||||
{ { string } { array } }
|
{ { string } { array } }
|
||||||
|
|
|
@ -311,6 +311,9 @@ C: <copy> copy-state
|
||||||
#! The check-length call forces partial dispatch
|
#! The check-length call forces partial dispatch
|
||||||
[ [ length check-length 0 ] keep ] 2dip <copy> (copy) drop ; inline
|
[ [ length check-length 0 ] keep ] 2dip <copy> (copy) drop ; inline
|
||||||
|
|
||||||
|
: subseq-unsafe ( from to seq -- subseq )
|
||||||
|
[ subseq>copy (copy) ] keep like ;
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
: subseq ( from to seq -- subseq )
|
: subseq ( from to seq -- subseq )
|
||||||
|
|
Loading…
Reference in New Issue