LISP Product of lists function

(defun my-product (list1 list2)
         (if (or (null list1) (null list2)) nil
              (let ( (a (* (car list1) (car list2))) ) (cons a (my-product (cdr list1) (cdr list2)))) 
         )
)

Or, without the use of LET

(defun my-product (list1 list2)
         (if (or (null list1) (null list2)) nil
              (cons (* (car list1) (car list2)) (my-product (cdr list1) (cdr list2)))
         )
)

Comments