list-1 | list to be joined |
list-2 | other list to be joined |
key | function for extracting value before test |
test | function for comparison of two values |
test-not | function for comparison of two values |
UNION function computes union of two lists. Resulting list contains elements that appear in one or other list. See INTERSECTION, SET-DIFFERENCE, SET-EXCLUSIVE-OR.
(union '(1 2 3) '(2 3 4)) => (1 2 3 4) (union '((1) (2) (3)) '((2) (3) (4))) => ((3) (2) (1) (2) (3) (4)) (union '((1) (2) (3)) '((2) (3) (4)) :test #'equal) => ((1) (2) (3) (4)) (union '((1) (2) (3)) '((2) (3) (4)) :key #'first) => ((1) (2) (3) (4))