A tuple, an object representing an immutable and ordered sequence of values of different types.
This implementation of a tuple is a "JSON" tuple, meaning that it is built on the fundamental concepts of the JSON format, enabling an easier exchange of data over the wire. This is because JSON is now the de-facto format for the data exchange on the web, which in turn is the standard for building distributed architectures, namely webservices. This means that a JSON tuple is the same concept as a JSON array, so an indexed sequence of values allowed in JSON, minus the "JSON object". Objects are not allowed since this would violate the rigid structure of a tuple: this would allow to objects to nest tuples inside them, which could nest other objects, which in turn could nest other tuples and so on and so forth. This would not correctly represent what in most programming languages is a sequence or list of elements. However, tuples can be nested into other tuples, enabling the equivalent of a matrix or of a jagged array. Their usefulness is in representing simple, not deeply nested data structures, such as messages or events exchanged in a distributed system.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes