Skip to content

Instantly share code, notes, and snippets.

@zhouqiang-cl
Created November 28, 2016 16:09
Show Gist options
  • Save zhouqiang-cl/ce3f408e2f108e767026bc646e328893 to your computer and use it in GitHub Desktop.
Save zhouqiang-cl/ce3f408e2f108e767026bc646e328893 to your computer and use it in GitHub Desktop.
common lisp 的宏 WITH-OPEN-FILE
语法
with-open-file (stream filespec options*) declaration* form* => results
参数和值
stream --- 一个变量
filespec --- 一个文件指示符
options --- 一个form, 会被求值
results --- forms的值
描述
with-open-file 用 open 函数去打开 filespec 所代表的文件, 并创建一个流指向这个文件.
options 作为 open 函数的参数
代码
* (with-open-file (test "x")
(read test))
ZHOU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment