Skip to content

Instantly share code, notes, and snippets.

@Liutos
Created June 15, 2012 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Liutos/2934880 to your computer and use it in GitHub Desktop.
Save Liutos/2934880 to your computer and use it in GitHub Desktop.
Demo of reading file
(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)))))
@unionx
Copy link

unionx commented Jun 15, 2012

我测了一下,sbcl的read-line函数比Python的readline函数慢多了啊

@Liutos
Copy link
Author

Liutos commented Jun 16, 2012

我还没读过太大的文件感觉不出来,暂时不成为问题;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment