Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun list-replace-nth (list n new-value)
- "Return a new list equivalent to LIST, but with the NTH (zero-indexed) value of LIST repalced with NEW-VALUE."
- (let ((list (copy-list list)))
- (setf (nth n list) new-value)
- list))
Advertisement
Add Comment
Please, Sign In to add comment