A Tuple is an immutable sequential data structure. The two most common ways to create a tuple is using the literal form with bracket characters or calling the tuple function directly.
[1 2 3] (tuple 1 2 3)
There are multiple ways to get an element from a Tuple. The most common one is the
get function that takes as first element the Tuple and as second element the index of the value that should be returned. Based on
get there are also
first function returns the first element of the Tuple and
second returns the second element of the Tuple.
(get [1 2 3] 2) # Evaluates to 3 (get  2) # Evaluates to nil (first [1 2 3]) # Evaluates to 1 (first ) # Evaluates to nil (second [1 2 3]) # Evaluates to 2 (second ) # Evaluates to nil
next can be used to return a new Tuple without the first element. The difference between
next is the behaviour on an empty Tuple. The
rest function returns a new empty Tuple. The
next function instead, returns a nil.
(rest [1 2 3]) # Evaluates to [2 3] (rest ) # Evaluates to  (next [1 2 3]) # Evaluates to [2 3] (next ) # Evaluates to nil
To append a value at the beginning or at the end of a Tuple
push can be used.
(cons 1 ) # Evaluates to [1 2] (push  2) # Evaluates to [1 2]
concat function can be used to concatenate two tuples.
(concat [1 2] [3 4]) # Evaluates to [1 2 3 4]
To count the number of element inside a Tuple the
count function can be used.
(count [1 2 3]) # Evaluates to 3 (count ) # Evaluates to 0