Skip to content

Instantly share code, notes, and snippets.

@zhouqiang-cl
Created December 7, 2016 11:58
Show Gist options
  • Save zhouqiang-cl/2c577c2af0e94f5acd321fd189a08084 to your computer and use it in GitHub Desktop.
Save zhouqiang-cl/2c577c2af0e94f5acd321fd189a08084 to your computer and use it in GitHub Desktop.
common lisp 的宏 NTH-VALUE
语法
nth-value n form => object
参数和值
n --- 一个非负整数
form --- 一个 form
object --- 一个 object
描述
nth-value 首先对 n 求值, 然后对 form 求值. 返回 form 的第 n 个值。如果 n 大于等于 form 的值的个数, 则返回 nil
代码
* (nth-value 0 (values 'a 'b))
A
* (nth-value 1 (values 'a 'b))
B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment