Skip to content

Instantly share code, notes, and snippets.

@gautamr
Created July 3, 2017 12:54
Show Gist options
  • Save gautamr/eb1e29a7913beb3858643b50fd1545d8 to your computer and use it in GitHub Desktop.
Save gautamr/eb1e29a7913beb3858643b50fd1545d8 to your computer and use it in GitHub Desktop.
Clojure Tips
;; 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