Handbook
Glossary
drop-prefix ( seq1 seq2 -- slice1 slice2 )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Comparing sequences
Prev:
mismatch ( seq1 seq2 -- i )
Next:
assert-sequence= ( a b -- )
Vocabulary
sequences
Inputs
seq1
a
sequence
seq2
a
sequence
Outputs
slice1
a slice
slice2
a slice
Word description
Outputs a pair of virtual sequences with the common prefix of
seq1
and
seq2
removed.
Definition
USING:
kernel
;
IN:
sequences
:
drop-prefix
( seq1 seq2 -- slice1 slice2 )
[
mismatch
]
2check
[
2dup
min-length
]
unless*
[
tail-slice
]
curry
bi@
;