Skip to content

Instantly share code, notes, and snippets.

@the-frey
the-frey / map-examples.clj
Created November 24, 2017 16:22
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)
@the-frey
the-frey / dojo-1.clj
Created November 24, 2017 16:18
First Coop Digital Clojure Dojo "Lesson"
;; 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