Skip to content

Instantly share code, notes, and snippets.

@zhouqiang-cl
Last active December 14, 2016 12:01
Show Gist options
  • Save zhouqiang-cl/0ebeb5b366c8094bc2fcdf6758940c21 to your computer and use it in GitHub Desktop.
Save zhouqiang-cl/0ebeb5b366c8094bc2fcdf6758940c21 to your computer and use it in GitHub Desktop.
common lisp 的宏 IGNORE-ERRORS
语法
ignore-errors form* => result*
参数和值
forms --- 一个隐式的 progn
results --- 正常情况下, 是 form 的求值结果, 如果抛出了异常, 则是 nil 和 condition
描述
ignore-errors 阻止 error 进入调试器
代码
* (setq filename "nosuchfile")
"nosuchfile"
* (ignore-errors (open filename :direction :input))
NIL
#<SB-INT:SIMPLE-FILE-ERROR "~@<~?: ~2I~_~A~:>" {1004B427F3}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment