- 论坛徽章:
- 0
|
还是practical common lisp中遇到的
在第十七章的accessor function那一节中
书上说,A SETF function is a way to extend SETF, defining a new kind of place that it knows how to set. The name of a SETF function is a two-item list whose first element is the symbol setf and whose second element is a symbol, typically the name of a function used to access the place the SETF function will set. A SETF function can take any number of arguments, but the first argument is always the value to be assigned to the place.
然后他的定义
(defun (setf customer-name) (name account)
(setf (slot-value account 'customer-name) name))
可是他调用的时候
(setf (customer-name my-account) "Sally Sue")
还说展开之后,Sally Sue对应于name, my-account对应于account
我不明白,函数的定义与调用是怎么联系起来的
谢谢 |
|