Skip to content

Instantly share code, notes, and snippets.

@uvtc
Created October 16, 2012 13:46
Show Gist options
  • Save uvtc/3899385 to your computer and use it in GitHub Desktop.
Save uvtc/3899385 to your computer and use it in GitHub Desktop.
(map + [1 2 3 4 5]
[6 7 8 9 10])
;; => ((+ 1 6)
; (+ 2 7)
; (+ 3 8)
; (+ 4 9)
; (+ 5 10))
;;----------------------------------
(iterate inc 5)
;; => (5
; (inc 5)
; (inc (inc 5))
; (inc (inc (inc 5)))
; ...)
;;----------------------------------
(reduce (fn [accum x]
(assoc accum (keyword x)
(str x x)))
{}
["a" "b" "c"])
; --> {}
; --> {:a "aa"}
; --> {:a "aa" :b "bb"}
; ==> {:a "aa" :b "bb" :c "cc"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment