Skip to content

Instantly share code, notes, and snippets.

@the-frey
the-frey / map-examples.clj
Created Nov 24, 2017
Clojure map examples for an anonymous function
View map-examples.clj
(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 Nov 24, 2017
First Coop Digital Clojure Dojo "Lesson"
View dojo-1.clj
;; 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
You can’t perform that action at this time.