Created
July 3, 2017 12:54
-
-
Save gautamr/eb1e29a7913beb3858643b50fd1545d8 to your computer and use it in GitHub Desktop.
Clojure Tips
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
;; Maps are function | |
(def inventors {:Lisp "McCarthy" :Clojure "Hickey"}) | |
(inventors :List) | |
;; -> McCarthy | |
;; But if you want to get something agianst nil then use get | |
(get inventors :Scala "Who?") | |
;; -> Who? | |
;; keywords are function; so following two give same output | |
(inventors :Lisp) | |
(:Lisp inventors) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment