Navigation
Synopsis Intersection of two lists.
Syntax Exp1 & Exp2
Types
Exp1 Exp2 Exp1 & Exp2
list[T1] list[T2] list[lub(T1,T2)]
Description Returns the intersection of the two list values of Exp1 and Exp2, i.e., the list value of EXp1 with all elements removed that do not occur in the list value of Exp2.
Examples
rascal>[1, 2, 3, 4, 5] & [4, 5, 6];
list[int]: [4,5]

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






Question [2].
The type of [57, 86, 41] & [51] is

Question [3].
[30,86,34] & [62,30,92,28,84,50,34] == 

Question [4].
[9, 5, 1, 0] & [2] == 



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.