(print (map (fn [a] (/ a 2)) (filter even? (range 1 11))))
Last active
December 21, 2015 22:42
-
-
Save iambowen/6376158 to your computer and use it in GitHub Desktop.
Clojure implementation
johnelf
commented
Aug 29, 2013
(take 5 (for [x (iterate inc 1) :when (zero? (rem x 2))] (/ x 2)))
(map (fn [x] (/ x 2)) (filter even? (range 1 11)))
(take 5 (map (fn [x] (/ x 2)) (filter even? (iterate inc 1))))
#!/usr/bin/env clj
(println (map #(/ %1 2) (filter even? (range 10))))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment