setUnion()

Synopsis

Returns a list of items that are members of either list1 or list2. Only one instance of any item will be returned, even if it appears multiple times in either or both lists .

Syntax

setUnion ( list1 As List, _
           list2 As List, _
           Optional key As Name = Identity, _
           Optional test As Name = Equal ) As List
Argument Type Description
list1 List the first list
list2 List the second list
key Name Optional; the name of function to be called with each item in the lists ; the function takes two arguments; the default is Identity.
test Name Optional; the name of test function to be applied to "key" results of items in the lists ; the function takes two arguments; the default is Equal.

Example 1

Intent >setUnion({a, b, c, d}, {a, b, c, e}) 
--> {e, c, b, a, d} 

Example 2

Intent >setUnion({a, a, b, c, d}, {a, b, c, e}) 
--> {e, c, b, a, d}