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

  1. (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:

  1. (d c b a)
  2. (4 c (b 2))
  3. ((a b c d) . 1)
  4. (((a c) (1 2)) . a)
  5. ((a 1) (b 2) (c 3) (d 4))

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!