Last active
April 30, 2017 10:45
-
-
Save deque-blog/2a32b6b4d29f4b0cc46b87eae3e1e919 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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