Skip to content

Instantly share code, notes, and snippets.

@DCarper
Created August 25, 2012 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DCarper/3467601 to your computer and use it in GitHub Desktop.
Save DCarper/3467601 to your computer and use it in GitHub Desktop.
test
(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