Handbook
Glossary
2selector ( quot -- selector accum1 accum2 )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Implementing sequence combinators
Prev:
selector-as ( quot exemplar -- selector accum )
Vocabulary
sequences
Inputs
quot
a
quotation
Outputs
selector
a
quotation
accum1
a
vector
accum2
a
vector
Word description
Creates two new vectors to accumulate values based on a predicate. The first vector accumulates values for which the predicate yields true; the second for false.
Definition
USING:
kernel
;
IN:
sequences
:
2selector
( quot -- selector accum1 accum2 )
V{
}
clone
V{
}
clone
[
[
push-either
]
3curry
]
2keep
;
inline