Question: I am learning LISP by Emacs. I made two lists: List1 and List2. I must use mapcar and lambda for List1 minus List2 and store

 I am learning LISP by Emacs. I made two lists: List1

I am learning LISP by Emacs.

I made two lists: List1 and List2.

I must use mapcar and lambda for List1 minus List2 and store the outcome in one list such as (3 2 1)

Why did I get three different lists? Can you help me fix the code?

Thank you

CL-USER> (defparameter *listi* '(5 4 3)) (defparameter *list2* '(2 2 2)) (mapcar (lambda (x) (mapcar (lambda (y) (- xy)) *list2*)) *listi*) ((3 3 3) (2 2 2) (1 1 1)) CL-USER> 0

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!