© Mark McDonnell 2017

Mark McDonnell, Quick Clojure, https://doi.org/10.1007/978-1-4842-2952-1_2

2. Data Structures and Syntax

Mark McDonnell

(1)southend-on-Sea, UK

Clojure provides a language API based upon a select set of data structures. What this means is that the syntax for certain programming functionality matches the underlying data structures.

For example, here are the main data structures that Clojure provides:

  • List: (1 2 3)

  • Vector: [1 2 3]

  • Map: {:foo "bar"}

  • Set: #{1 2 3}

Note

There are other data structures, terminology, and related concepts, as well as a great reference guide, which can be found in the official Clojure documentation.1 However, for the purposes of what we wish to cover in this chapter, it can be a little “low-level” at times, ...

Get Quick Clojure: Effective Functional Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.