Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
;; Create a new map associating:
;; - "John" to :first-name
;; - "Doe" to :last-name
{:first-name "John"
:last-name "Doe"}
=> {:first-name "John", :last-name "Doe"}
;; Add the age of John Doe to the map:
;; Associate the value 31 to the key :age
(assoc
{:first-name "John"
:last-name "Doe"}
:age 31)
=> {:first-name "John", :last-name "Doe", :age 31}
;; Retrieve the first name of John Doe
;; Search for the key :first-name
(get
{:first-name "John"
:last-name "Doe"}
:first-name)
=> "John"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment