Handbook
Glossary
assoc-subset? ( assoc1 assoc2 -- ? )
Factor handbook
»
The language
»
Collections
»
Associative mapping operations
»
Set-theoretic operations on assocs
Next:
assoc-intersect ( assoc1 assoc2 -- intersection )
Vocabulary
assocs
Inputs
assoc1
an
assoc
assoc2
an
assoc
Outputs
?
a
boolean
Word description
Tests if
assoc2
contains all key/value pairs of
assoc1
.
Definition
USING:
kernel
;
IN:
assocs
:
assoc-subset?
( assoc1 assoc2 -- ? )
[
[
swap
]
]
dip
[
at*
[
=
]
[
2drop
f
]
if
]
curry
compose
assoc-all?
;