ANSI Common Lisp 5 Data and Control Flow 5.3 Dictionary of Data and Control Flow
place &optional environment
vars, vals, store-vars, writer-form, reader-form
- Arguments and Values:
place - a place.
environment - an environment object.
vars, vals, store-vars, writer-form, reader-form - a setf expansion.
five values constituting the setf expansion for place
in environment; see Section 22.214.171.124 Setf Expansions.
If environment is not supplied or nil,
the environment is the null lexical environment.
NIL, NIL, (#:G0001), (SETQ X #:G0001), X
;;; This macro is like 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)))
(defsetf frob (x) (value)
`(setf (car ,x) ,value)) FROB
;;; The following is an error; an error might be signaled at macro expansion time
(flet ((frob (x) (cdr x))) ;Invalid
(xpop (frob z)))
- See Also:
Any compound form is a valid place,
since any compound form whose operator f has no setf expander
are expanded into a call to (setf f).
- Allegro CL Implementation Details: