Question: In LISP, code the function, ( evalEach lis ) which evaluates each item in the lis using the built-in EVAL function. Its functional value is
In LISP, code the function, (evalEach lis) which evaluates each item in the lis using the built-in EVAL function. Its functional value is the value of the last expression evaluated.
> (evalEach '( (setf A 5) (print 'hello) (print 'there) A))
HELLO
THERE
5
> (evalEach '( (setf x 10 ) (setf A '(x y z)) (print A) (setf B (car A)) (set B (+ 5 x)) )
(X Y Z)
15
> (print B)
X
X
> (print X)
15
15
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
