4 ms·
Shouldn't it be (+ a (apply + b))
by CodeArtisan 5mo ago
Shouldn't it be
(+ a (apply + b))
- db48x 5mo agoAlmost. 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.
- gus_massa 5mo agoNo, 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.