Question 2: Tail recursion [4]

Below we show a recursive function to count the instances of element e in list L.

   (defun freq (e L)
      (cond
          ((not (listp L)) nil)
          ((null L) 0)
          ((equalp e (car L)) (+ 1 (freq e (cdr L))))
          (t (freq e (cdr L)))))

You are to implement a tail-recursive version, by using an extra parameter to keep track of the number of instances counted so far.