Contents    Page-10    Prev    Next    Page+10    Index   

Union and Set Difference

The union (written ) of two sets is the set of elements that are members of either set.


(union '(a b c) '(a c e))   ->  (b a c e)

The set difference (written -) of two sets is the set of elements that are members of the first set but not the second set.


(set-difference '(a b c) '(a c e))   ->  (b)
Note that set difference is asymmetric: unique members of the second set, such as e above, do not appear in the output.