Handbook
Glossary
intersect! ( set1 set2 -- set1 )
Factor handbook
»
The language
»
Collections
»
Sets
»
Operations on sets
Prev:
diff! ( set1 set2 -- set1 )
Next:
null? ( set -- ? )
Vocabulary
sets
Inputs
set1
a
set
set2
a
set
Outputs
set1
a
set
Word description
Removes all members from
set1
not contained in
set2
.
Side effects
Modifies
set1
Definition
USING:
kernel
sequences
sets.private
;
IN:
sets
:
intersect!
( set1 set2 -- set1 )
dupd
sequence/tester
pick
[
delete
]
curry
[
[
[
dup
]
]
dip
[
[
drop
]
]
compose
compose
]
dip
[
if
]
curry
compose
each
;