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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!