Created
March 15, 2014 03:29
-
-
Save raskchanky/9561465 to your computer and use it in GitHub Desktop.
Different Clojure styles
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 hamming-distance [a b] | |
(->> | |
(map #(= %1 %2) a b) | |
(filter false?) | |
count)) |
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 hamming-distance [a b] | |
(count | |
(filter false? | |
(map #(= %1 %2) a b)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don't really read or write a ton of Clojure but personally version 2 is easier for me to follow.