Question: (3 points each) Consider the following two variable bindings in Lisp: (setq x (a b c d)) (setq y (4 3 2 1)) Using only
- (3 points each) Consider the following two variable bindings in Lisp:
(setq x (a b c d))
(setq y (4 3 2 1))
Using only the variables x and y and the functions car, cdr and cons, provide Lisp S-expressions for generating the following:
- (d c b a)
- (4 c (b 2))
- ((a b c d) . 1)
- (((a c) (1 2)) . a)
- ((a 1) (b 2) (c 3) (d 4))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
