2021年2月1日星期一

Lisp function that recursively adds elements to a list

I working on a lisp function that will accept two parameters, the second of which is a list. It will take the first parameter and add it after every element of the second parameter. This is as far as I got:

(defun rd(list n1 lis2)    (rd ((n1) (cdr (lis2))))    (cons (n1) (cons (car (lis2))))    )  

If the two parameters are 'aa and '(b c d f), the desired output should be: aa b aa c aa d aa f aa

https://stackoverflow.com/questions/66003088/lisp-function-that-recursively-adds-elements-to-a-list February 02, 2021 at 11:03AM

没有评论:

发表评论