clojure icon indicating copy to clipboard operation
clojure copied to clipboard

Clojure Idiom - tuple

Open practicalli-johnny opened this issue 3 years ago • 0 comments

A Tuple in Clojure is a very simple data structure, usually represented as two related values in a vector

[value1 value2]

The value of a tuple is in its simplicity, although greater responsibility is required to use the tuple values in the desired way.

The tuple provides less structure and meaning than a hash-map, as the values in the tuple have no explicit key (although the first value could be perceived as the key, but then a hash-map representation would feel more appropriate)

Review Clojure Design Club discussions on tuples for more examples of how they are used.

practicalli-johnny avatar Jun 14 '22 10:06 practicalli-johnny