intersect ( set1 set2 -- set )
Factor handbook » The language » Collections » Sets » Operations on sets

Prev:diff ( set1 set2 -- set )
Next:union ( set1 set2 -- set )


Vocabulary
sets

Inputs
set1a set
set2a set


Outputs
seta set


Word description
Outputs a set consisting of elements present in both set1 and set2.This word has a default definition which works for all sets, but set implementations may override the default for efficiency.

Examples
USING: sets prettyprint ; { 1 2 3 } { 2 3 4 } intersect .
{ 2 3 }


See also
diff, union

Definition

GENERIC: intersect ( set1 set2 -- set )


Methods