(defun prime? (n)
  (loop for i from 2 to (/ n 2) do
    (when (= (mod n i) 0)
          (return-from prime? NIL)))
  T)
 
(defun take-n-primes (n)
  (labels ((next-prime (current)
            (loop for i from (1+ current) do
              (when (prime? i)
                (return i)))))
    (let ((primes nil)
          (current-prime 2))
      (dotimes (i n)
        (push current-prime primes)
        (setf current-prime (next-prime current-prime)))
      (nreverse primes))))
 
(print (take-n-primes 10))