You want to use funcall, reduce or apply (there might be more suitable functions that call your function in some other way, like map, mapc, mapcar, mapcon etc.). If you know the number of arguments at the time you call the function, it is better to use funcall, use apply otherwise. E.g.:
- Code: Select all
(defun foo (a b) (format t "a + b = ~s~&" (+ a b)))
(funcall #'foo 2 3)
(apply #'foo '(2 3))
Also: (defun (something (something-else)) ...) means that you want to declare a function with name (something (something-else)). This is not allowed (by the defun macro) because it wants the first argument to be a symbol (or, some times, a list - if it is a setf macro), not a form to execute.
You can do M-x slime-hyperspec-lookup RET defun RET (if you use Emacs + SLIME for writing your code) to see the reference.