The task is as follows: depending on the passed function value, with the help of perform either the addition of the list elements or the multiplication of the list elements. those.
apply func(x) '(1 2 3 4) if x = 1, then the result is 10, if x = 2, then 24
Here is what I did:
I define the func function
(defun func_(x) (cond ((eql 1 x)(plus))(eql 2 x)(TIMES)) then try to call apply
(apply func_(1) '(1 2 3 4)) but the compiler gives an error
Error: The variable FUNC_ is unbound.
Fast links are on: do (si :: use-fast-links nil) for debugging
Error signalled by EVAL.
Backtrace: EVAL
Broken at SYSTEM :: GCL-TOP-LEVEL.