%mathpiper,def="Union"

Function("Union",{list1,list2})
[
  RemoveDuplicates(Concat(list1,list2));
];

%/mathpiper



%mathpiper_docs,name="Union",categories="User Functions;Lists (Operations)"
*CMD Union --- return the union of two lists
*STD
*CALL
	Union(l1, l2)

*PARMS

{l1}, {l2} -- two lists

*DESC

The union of the lists "l1" and "l2" is determined and
returned. The union contains all elements that occur in one or both of
the lists. In the resulting list, any element will occur only once.

*E.G.

In> Union({a,b,c}, {b,c,d});
Result: {a,b,c,d};
In> Union({a,e,i,o,u}, {f,o,u,r,t,e,e,n});
Result: {a,e,i,o,u,f,r,t,n};
In> Union({1,2,2,3,3,3}, {2,2,3,3,4,4});
Result: {1,2,3,4};

*SEE Intersection, Difference
%/mathpiper_docs