Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi, I am learning LISP by Emacs. I have a question. Here is the example: I see the number 4 plus the list (1 2
Hi, I am learning LISP by Emacs. I have a question.
Here is the example:
I see the number 4 plus the list (1 2 3 4 5) = ( 5 6 7 8 9)
But please help me fix the code, how can two lists addition.
Ex: (add-to-list '(1 1 1 1 1) '(1 2 3 4 5))
(2 3 4 5 6)
[1]> (defun add-to-list (val list-of-numbers) (mapcar #'(lambda (num) (+ val num)) list-of-numbers)) ADD-TO-LIST [2]> (add-to-list 4 (1 2 3 4 5)) (5 6 7 8 9)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started