Handbook
Glossary
filter-as ( ... seq quot: ( ... elt -- ... ? ) exemplar -- ... subseq )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Sequence combinators
Prev:
filter ( ... seq quot: ( ... elt -- ... ? ) -- ... subseq )
Next:
partition ( ... seq quot: ( ... elt -- ... ? ) -- ... trueseq falseseq )
Vocabulary
sequences
Inputs
seq
a
sequence
quot
a
quotation
with stack effect
( ... elt -- ... ? )
exemplar
a
sequence
Outputs
subseq
a new sequence
Word description
Applies the quotation to each element in turn, and outputs a new sequence of the same type as
exemplar
containing the elements of the original sequence for which the quotation output a true value.
See also
filter
,
filter!
,
reject
,
reject-as
,
reject!
,
sift
,
harvest
Definition
USING:
kernel
sequences.private
;
IN:
sequences
:
filter-as
( ... seq quot: ( ... elt -- ... ? ) exemplar -- ... subseq )
pick
length
over
[
(selector-as)
[
each
]
dip
]
2curry
dip
like
;
inline