% Function GET-SETF-EXPANSION
Function GET-SETF-EXPANSION
get-setf-expansion place &optional environment
=> vars, vals, store-vars, writer-form, reader-form
place - place
environment - 環境オブジェクト
vars, vals, store-vars, writer-form, reader-form - setfの展開
environment下におけるplaceのsetfの展開を構築するための 5つの値を返却します。 5.1.1.2. Setfの展開をご確認ください。
environmentが与えられなかったか、あるいはnilのときは、
環境はnullのレキシカルな環境です。
(get-setf-expansion 'x)
=>  NIL, NIL, (#:G0001), (SETQ X #:G0001), X 
;;; これはPOPに似たマクロ
 (defmacro xpop (place &environment env)
   (multiple-value-bind (dummies vals new setter getter)
                        (get-setf-expansion place env)
      `(let* (,@(mapcar #'list dummies vals) (,(car new) ,getter))
         (if (cdr new) (error "Can't expand this."))
         (prog1 (car ,(car new))
                (setq ,(car new) (cdr ,(car new)))
                ,setter))))
 
 (defsetf frob (x) (value) 
     `(setf (car ,x) ,value)) =>  FROB
;;; 下記の例はエラー、エラーはマクロ展開時に発生する
 (flet ((frob (x) (cdr x)))  ;不正
   (xpop (frob z)))
なし。
なし。
defsetf,
define-setf-expander,
setf
compound-formの操作fがsetf展開を持たないなら
(setf f)のように展開されるので、
どのようなcompound-formも有効なplaceになります。