Handbook
Glossary
assoc-partition ( ... assoc quot: ( ... key value -- ... ? ) -- ... true-assoc false-assoc )
Factor handbook
»
The language
»
Collections
»
Associative mapping operations
»
Associative mapping combinators
Prev:
assoc-reject-as ( ... assoc quot: ( ... key value -- ... ? ) exemplar -- ... subassoc )
Next:
assoc-any? ( ... assoc quot: ( ... key value -- ... ? ) -- ... ? )
Vocabulary
assocs
Inputs
assoc
an
assoc
quot
a
quotation
Outputs
true-assoc
an
assoc
false-assoc
an
assoc
Word description
Calls a predicate quotation on each key of the input assoc. If the test yields true, the key/value pair is added to
true-assoc
; if false, it's added to
false-assoc
.
Definition
USING:
assocs.private
kernel
sequences
;
IN:
assocs
:
assoc-partition
( ... assoc quot: ( ... key value -- ... ? ) -- ... true-assoc false-assoc )
[
assoc-operator
partition
]
[
drop
]
2bi
[
assoc-like
]
curry
bi@
;
inline