Genius has some basic set theoretic functionality built in. Currently a set is just a vector (or a matrix). Every distinct object is treated as a different element.
Just like vectors, objects
in sets can include numbers, strings,
null, matrices and vectors. It is
planned in the future to have a dedicated type for sets, rather than using vectors.
Note that floating point numbers are distinct from integers, even if they appear the same.
That is, Genius will treat
as two distinct elements. The
null is treated as an empty set.
To build a set out of a vector, use the MakeSet function. Currently, it will just return a new vector where every element is unique.
genius> MakeSet([1,2,2,3]) = [1, 2, 3]
genius> Union([1,2,3], [1,2,4]) = [1, 2, 4, 3]
genius> IsIn (1, [0,1,2]) = true