May 2018
Beginner to intermediate
290 pages
6h 43m
English
Virtually all modern programming languages include some kind of data structure that lets you associate arbitrary keys with equally arbitrary values, and Clojure is no exception. Appropriately enough, Clojure calls its arbitrary mapping data structure a map. In keeping with Clojure’s barebones philosophy, the map literal syntax only requires a pair of curly braces and some key/value pairs. For instance, this:
| | {"title" "Oliver Twist" "author" "Dickens" "published" 1838} |
creates a map that associates the string "title" with "Oliver Twist", "author" with "Dickens", and "published" with 1838.
You can also cook up a new map with the hash-map function:
| | (hash-map "title" "Oliver Twist" |
| | "author" ... |
Read now
Unlock full access