Created
November 23, 2016 10:36
-
-
Save zhouqiang-cl/a96d8895f349ad16a0ec089dd22ba37e to your computer and use it in GitHub Desktop.
common lisp 的宏 INCF, DECF
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
语法 | |
incf place [delta-form] => new-value | |
decf place [delta-form] => new-value | |
参数和值 | |
place --- 可以简单的认为是一个对象 | |
delta-form --- 一个 delta 的 form | |
delta --- 一个数字 | |
new-value --- 新的值 | |
描述 | |
incf 增加 place 的值 | |
decf 减少 place 的值 | |
代码 | |
* (setq n 0) | |
0 | |
* (incf n) | |
1 | |
* (incf n 2.5) | |
3.5 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment