Skip to content

Clojure Idiom - tuple #421

Open
Open
@practicalli-johnny

Description

@practicalli-johnny

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions