# Basic set theory functions for Genius

# FIXME: Genius should really implement native set type

SetHelp ("Union", "sets", "Returns a set theoretic union of X and Y (X and Y are vectors pretending to be sets)");
function Union(X,Y) =
  (
   for x in X do
    if not IsIn(x,Y) then Y=[Y,x];
   Y
  )

SetHelp ("MakeSet", "sets", "Returns a set where every element of X appears only once");
function MakeSet(X) =
  (
   S = null;
   for x in X do
    if not IsIn(x,S) then S=[S,x];
   S
  )
