ColdC: Function/Method Reference: union()


LIST union(LIST list, LIST list2)

This function adds each element of list2 which does not already exist in list to list and returns the result. Elements which exist more than once in list2 will only be added to list once, but duplicate elements in list1 will remain.

Examples:

union([2, 3, 4], [4, 5, 4, 6])
=> [2, 3, 4, 5, 6]

union([2, 2, 4, 5], [4, 5, 6, 6, 7])
=> [2, 2, 4, 5, 6, 7])


Last Modified on 24 Mar 1996
Copyright © 1995, 1996, Brandon Gillespie