Created
August 25, 2012 16:29
-
-
Save DCarper/3467601 to your computer and use it in GitHub Desktop.
Revisions
-
Dan Carper created this gist
Aug 25, 2012 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ (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))