Handbook
Glossary
tail? ( seq end -- ? )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Testing sequences
Prev:
head? ( seq begin -- ? )
Next:
subseq? ( subseq seq -- ? )
Vocabulary
sequences
Inputs
seq
a
sequence
end
a
sequence
Outputs
?
a
boolean
Word description
Tests if
seq
ends with
end
. If
end
is longer than
seq
, this word outputs
f
.
Definition
USING:
kernel
sequences.private
;
IN:
sequences
:
tail?
( seq end -- ? )
[
shorter?
]
2check
[
2drop
f
]
[
[
length
[
tail-slice*
]
1check
]
keep
mismatch-unsafe
not
]
if
;