(

computer science):

A

*tuple* is what a

mathematician would call a

point in a (usually

finite)

cartesian product.

Say you have types T_{1}, T_{2}, ..., T_{k}. We view the types T_{i} as the *sets* of the objects of that type. Then the `k`-tuple type T = T_{1}×...×T_{k} is the set of elements (`a`_{1},...,`a`_{k}) with each `a`_{i} coming from its respective T_{i}.

Here's a concrete example. (true, 17, 3.14159) is a tuple of type `bool`×`int`×`float`. Tuples *are* ordered, so (1,2) and (2,1) are distinct tuples of type `int`×`int`.

Tuples are somewhat akin to records (structs in C). But whereas every element of a record has a *name*, tuples don't distinguish their elements by name, but only by position.

Many functional programming languages offer tuples as composite types. Prolog's functors are a similar construct. I'm told that the parallel processing language Linda uses tuples extensively.