Created
August 25, 2012 16:29
-
-
Save DCarper/3467601 to your computer and use it in GitHub Desktop.
test
This file contains hidden or 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
(def square (fn [n] (* n n))) | |
(def sum-squares | |
(fn [& args]( | |
(+ (map square args )) | |
)) | |
) | |
(prn "squares: " (map square [1 2 3 4])) | |
(prn "hardcoded sum of squares:" (apply + (map square [1 2 3 4]))) | |
(prn "sum-squares:" (sum-squares 1 2 3 4)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment