Reading Text from a File
; Read in successive lines of test from a file.
(defun text-from-file ()
(with-open-file (file "input.txt" :direction :input)
(let (the-line)
(loop
(setq the-line (read-line file nil 'done))
(if (eq the-line 'done) (return))
(format t "The input line was: ~A~%" the-line)
)
'bye
)
) )
Previous slide
Back to first slide
View graphic version