Lisp Distinct
(defun distinct (a)
  (length (remove-duplicates a :test #'equal)))

This counts unique values by tracking what has already been seen.