Navigation
Synopsis Intersection of two sets.
Syntax Exp1 & Exp2
Types
Exp1 Exp2 Exp1 & Exp2
set[T1] set[T2] set[lub(T1,T2)]
Description Returns the intersection of the two set values of Exp1 and Exp2. The intersection consists of the common elements of both sets.
Examples
rascal>{1, 2, 3, 4, 5} & {4, 5, 6};
set[int]: {4,5}

Questions
Question [1]. When you compute the intersection of two sets, the number of elements in the result is always:




Question [2].
The type of [11, 90, 54] & [6, 6, 61, 71] is

Question [3].
{37,76,13,56,25,94} & {66,76,13,85} == 

Question [4].
{8, 4} & {8, 7, 3, 6} == 



Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.