Skip to content

Instantly share code, notes, and snippets.

@remexre
Last active October 7, 2016 07:17
Show Gist options
  • Save remexre/a24200701cf97346ed960cccb120496f to your computer and use it in GitHub Desktop.
Save remexre/a24200701cf97346ed960cccb120496f to your computer and use it in GitHub Desktop.
(defn times-two (x)
(* x 2))
(defn div-by-three (x)
(= (% x 3) 0))
;; With threading macro:
(->>
(range 100)
(filter div-by-three)
(map times-two)
(fold +))
;; Without threading macro:
(fold +
(map times-two
(filter div-by-three
(range 100))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment