Can we have a function that can add two list to one, such as (add ‘(1 2 3) ‘(4 5 6)) = (5 7 9)
(defun add-two-list (l r) ; e.g. (1 2 3) (2 3 4) ; returns (3 5 7) (setf return-value '()) (loop for i from 0 to (- (length l) 1) do (setf return-value (cons (+ (nth i l) (nth i r)) return-value)) ) (reverse return-value) ) |