Skip to content

Instantly share code, notes, and snippets.

@the-frey
Created November 24, 2017 16:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save the-frey/5e52096444973b10405f5413ba267ca5 to your computer and use it in GitHub Desktop.
Save the-frey/5e52096444973b10405f5413ba267ca5 to your computer and use it in GitHub Desktop.
Clojure map examples for an anonymous function
(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)
;=> [2 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment