Created
June 15, 2012 05:49
-
-
Save Liutos/2934880 to your computer and use it in GitHub Desktop.
Demo of reading file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(with-open-file (stream "/home/liutos/src/lisp/foo.lisp" | |
:direction :input) | |
(loop | |
(let ((line (read-line stream nil))) | |
(if line | |
(format t "~A~%" line) | |
(return))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我测了一下,sbcl的read-line函数比Python的readline函数慢多了啊