Last active
October 7, 2016 07:17
-
-
Save remexre/a24200701cf97346ed960cccb120496f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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