Hacker News new | ask | show | jobs
by CodeArtisan 29 days ago
Shouldn't it be (+ a (apply + b))
2 comments

Almost. It should be (+ a (apply #'+ b)). Common Lisp is a Lisp-2, so a + in the argument position is assumed to be a variable named +, not the function named +, unless you specify otherwise.
No, the idea is to assume for this example that + only can be used with two arguments and define a new function that can be used with any number of arguments.