Hello
I try to create a function that substitutes more than one item at a time.
it should work like this
(list-substitute '(1 2 3 4 5) '((1 8) (2 29))) => (8 29 3 4 5)
My attempt is:
(defun list-substitute (l subs)
(loop for i in subl
for x = (substitute (first subl) (second subs) l) then (substitute (first subl) (second subs) x)
return x ))
Unfortunately list in the first inlet doesn’t get modified.
What am I doing wrong?
Thanks
Frank