Created
November 20, 2016 07:42
-
-
Save zhouqiang-cl/551244535f259086aa1f1e42860d5612 to your computer and use it in GitHub Desktop.
存取器 VALUES 和函数 VALUES-LIST
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
语法 | |
values &rest object => object* | |
values-list list => element* | |
参数和值 | |
object --- 一个对象 | |
list --- 一个列表 | |
elements --- 列表的元素 | |
描述 | |
values 返回多个值 | |
代码片段 | |
* (values 1 (values 1 2 3)) | |
1 | |
1 | |
* (values 4 5 6) | |
4 | |
5 | |
6 | |
* (values-list '(1 2 3)) | |
1 | |
2 | |
3 | |
注 | |
(values-list list) == (apply #'values list) | |
values是个函数,所以他的参数只取每个参数form的第一个值(primary value) | |
TODO | |
给values作为赋值语句(setf (values &rest place) new-values) | |
解释一下MULTIPLE-VALUE-BIND |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment