Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active April 30, 2017 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/2a32b6b4d29f4b0cc46b87eae3e1e919 to your computer and use it in GitHub Desktop.
Save deque-blog/2a32b6b4d29f4b0cc46b87eae3e1e919 to your computer and use it in GitHub Desktop.
;; 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