Skip to content

Instantly share code, notes, and snippets.

@zhouqiang-cl
Created November 23, 2016 10:36
Show Gist options
  • Save zhouqiang-cl/a96d8895f349ad16a0ec089dd22ba37e to your computer and use it in GitHub Desktop.
Save zhouqiang-cl/a96d8895f349ad16a0ec089dd22ba37e to your computer and use it in GitHub Desktop.
common lisp 的宏 INCF, DECF
语法
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