I have a list of structures and I want to write a function that modifies some slots in structures without affecting the original list. I tried using the copy list, but its not deep enough; slot values ββalso change in the source list. My question is, is there a built-in function that does what I want ?, or should I write my own ?. Thanks.
EDIT:
I continued and wrote my own function, is there a built-in that will do this?
(defun deep-copy (li) (if (null li) nil (cons (copy-structure (car li)) (deep-copy (rest li)))))
source share