Skip to content
Jan Špaček edited this page Apr 12, 2016 · 1 revision

Tuples are immutable fixed-size containers that can be used as basic building blocks of more complicated structures. Note that the ,,trivial cases'' of 0-tuples and 1-tuples are well-defined.

  • (tuple? t) returns true if t is a tuple (of an arbitrary length).
  • (tuple-len t) returns the length of the tuple t.
  • (tuple-n? n t) returns true if t is a tuple with n elements.
  • (tuple-<n>? t) returns true if t is a tuple with <n> elements. Versions tuple-0? to tuple-8? are provided.
  • (tuple-<n> a0 ... a<n>) makes an <n>-tuple with elements a0, ..., a<n>. Versions tuple-0 to tuple-8 are provided.
  • (get-<n> t) returns <n>th (zero-based) element of tuple t (which must contain at least <n> + 1 elements). Versions get-0 to get-8 are provided.