title: Multiplying numbers in a list (coordinate-wise) without using mapcar in Lisp
body: <p>I'm having trouble with the output of my code, I think it's when I'm checking conditions for the null of my lists. </p>
  
  <p>The question I am trying to complete is: Write a function <code>vecmul</code> that will take as inputs two simple lists of numbers. vecmul should multiply these lists coordinate-wise as one would multiply vectors. Assume the two lists are the same length. [For example, <code>(vecmul '(2 3 4 5) '(1 4 5 2))</code> returns <code>(2*1 3*4 4*5 5*2)</code> or <code>(2 12 20 10)</code>. You are not allowed to use <code>mapcar</code> for this function]</p>
  
  <p>So far I have </p>
  
  <pre><code>(defun vecmul (list list2)
    (cond ((null list) 0)
       (t (cons (* (car list) (car list2))
                   (vecmul (cdr list) (cdr list2))))))
  
  [170]&gt; (setq l '(2 4 6))
  (2 4 6)
  [171]&gt; (setq r '(1 3 5))
  (1 3 5)
  [172]&gt; (vecmul l r)
  (2 12 30 . 0)
  </code></pre>
  
  <p>I'm getting the correct numbers, it's just that the list is adding the "." and the "0" at the end of the list. I'm pretty sure it's because i'm not stopping the recursion right or not working the cond right. I'm just not entirely sure how to correct it.</p>