Skip to content

Instantly share code, notes, and snippets.

@zhouqiang-cl
Created December 7, 2016 10:18
Show Gist options
  • Save zhouqiang-cl/b2d9042ff1b9f6fe7fc7e6e6b712173a to your computer and use it in GitHub Desktop.
Save zhouqiang-cl/b2d9042ff1b9f6fe7fc7e6e6b712173a to your computer and use it in GitHub Desktop.
common lisp 的宏 WHEN, UNLESS
语法
when test-form form* => result*
unless test-form form* => result*
参数和值
test-form --- 一个 form
forms --- 一个隐式的 progn
results --- when 表达式中,当 test-form 为 true 时, 为 form的值. 在 unless 中, test-form 为 false 时, 为 form的值
否则为 nil
描述:
见参数和值里的results
代码
* (when t 'hello)
HELLO
* (unless t 'hello)
NIL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment