Handbook
Glossary
push-when ( ..a elt quot: ( ..a elt -- ..b ? ) accum -- ..b )
Vocabulary
sequences
Inputs
elt
an
object
quot
a
quotation
with stack effect
( ..a elt -- ..b ? )
accum
a resizable mutable sequence
Outputs
None
Word description
Adds the element at the end of the sequence if the quotation yields a true value.
Notes
This word is a factor of
filter
.
See also
push
,
push-either
,
pop
,
pop*
,
prefix
,
suffix
,
suffix!
Definition
USING:
kernel
;
IN:
sequences
:
push-when
( ..a elt quot: ( ..a elt -- ..b ? ) accum -- ..b )
[
keep
]
dip
rot
[
push
]
[
2drop
]
if
;
inline