(
computer science):
A
tuple is what a
mathematician would call a
point in a (usually
finite)
cartesian product.
Say you have types T1, T2, ..., Tk. We view the types Ti as the sets of the objects of that type. Then the k-tuple type T = T1×...×Tk is the set of elements (a1,...,ak) with each ai coming from its respective Ti.
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.