Synopsis Intersection of two maps.
Syntax Exp1 & Exp2
Exp1 Exp2 Exp1 & Exp2
map[T11, T12] set[T2] set[lub(T1,T2)]
Description Returns the intersection of the two map values of Exp1 and Exp2, i.e., a map that contains the key/value pairs that occur in both maps.
rascal>("apple": 1, "pear": 2) & ("banana": 3, "apple": 1);
map[str, int]: ("apple":1)
rascal>("apple": 1, "pear": 2) & ("banana": 3, "apple": 4);
map[str, int]: ()
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