title: Occurrence of symbol A found anywhere in L. LISP
body: <p>Here is my function </p>
  
  <pre><code>(defun freq (symbol_A List_L)
      (cond ((atom (car List_L)) 
          (cond ((eq (car List_L) symbol_A) t (+ 1 (freq symbol_A (cdr List_L))))
              (t 0))) 
      (T (freq symbol_A (cdr List_L))))
  )
  </code></pre>
  
  <p>I am getting an error variable ATOM has no value. Here is what I am testing with </p>
  
  <pre><code>(freq  'c '((a c) c e)) --&gt; 2
  (freq  'f '(((s) o ) d)) --&gt; 0
  (freq  'f '(((f) f) f f)) --&gt; 4
  </code></pre>
  
  <p>Can not understand where is my error. </p>
  
  <p>I also tried this: </p>
  
  <pre><code>(defun freq (a L)
    (cond
     ((null L) 0)
     ((equal a (car L)) (+ 1 (freq a (cdr L))))
     (t (freq a (cdr L)))))
  </code></pre>