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
(map inc [1 2]) | |
;; this is equivalent to the transformations: | |
;; (inc 1) | |
;; (inc 2) | |
;=> [2 3] | |
(map #(+ 1 %) [1 2]) | |
;; this is equivalent to the transformations: | |
;; #(+ 1 1) | |
;; #(+ 1 2) |
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
;; define something | |
(def foo 1) | |
;; define a function | |
(def hello-world | |
(fn [] | |
(println "Hello world"))) | |
;; define a function using terse anonymous function syntax | |
(def hello-2 |