Created
December 7, 2016 10:18
-
-
Save zhouqiang-cl/b2d9042ff1b9f6fe7fc7e6e6b712173a to your computer and use it in GitHub Desktop.
common lisp 的宏 WHEN, UNLESS
This file contains hidden or 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
语法 | |
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