Skip to main content

Tuple

Synopsis

An ordered, fixed length, sequence of values of possibly different type.

Description

A tuple is an ordered fixed length sequence of values of possibly different type.

In Rascal a tuple is written as < V₁, ..., Vₙ > and a tuple type has the form type[T₁, ..., Tₙ], Tᵢ represents the type of element i. Tuple have two major applications:

  • As tuples in a ./Relation.
  • For ad-hoc packaging of values, for instance, to return multiple-values from a function.

See Tuple Values for the operations on tuples.