How can I read the contents of a file into a list in Lisp?

How about

(defun get-file (filename)
  (with-open-file (stream filename)
    (loop for line = (read-line stream nil)
          while line
          collect line)))

Leave a Comment