Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (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))
Add Comment
Please, Sign In to add comment