Handbook
Glossary
cut-when ( ... seq quot: ( ... elt -- ... ? ) -- ... before after )
Vocabulary
sequences
.
extras
Inputs
seq
a
sequence
quot
a
quotation
Outputs
before
an
object
after
an
object
Word description
Cut the given sequence before the first element of
seq
that returns a truthy value when passed into
quot
. The element will be the first in the
after
sequence. If no elemnts satisfy the predicate,
seq
will be empty.
Definition
USING:
kernel
sequences
;
IN:
sequences.extras
:
cut-when
( ... seq quot: ( ... elt -- ... ? ) -- ... before after )
[
find
drop
]
keepd
swap
[
cut
]
[
f
over
like
]
if*
;
inline