User Tools

A PCRE internal error occured. This might be caused by a faulty plugin

====== Function GET-SETF-EXPANSION ====== ====Syntax==== * **get-setf-expansion** //place ''&optional'' environment// → //vars, vals, store-vars, writer-form, reader-form// ====Arguments and Values==== * //place// - a //[[CL:Glossary:place]]//. * //environment// - an //[[CL:Glossary:environment]]// //[[CL:Glossary:object]]//. * //vars, vals, store-vars, writer-form, reader-form// - a //[[CL:Glossary:setf expansion]]//. ====Description==== Determines five values constituting the //[[CL:Glossary:setf expansion]]// for //place// in //environment//; see section {\secref\SetfExpansions}. If //environment// is not supplied or **[[CL:Constant Variables:nil]]**, the environment is the //[[CL:Glossary:null lexical environment]]//. ====Examples==== <blockquote> (get-setf-expansion 'x) <r>[[CL:Constant Variables:NIL]] [[CL:Constant Variables:NIL]] (#:G0001) ([[CL:Special Operators:SETQ]] X #:G0001) X</r> ;;; TODO fix the below example, it seems very broken - ;;; complains about the NEW variable etc. ([[CL:Macros:defmacro]] xpop (place &environment env) ; This macro is like POP ([[CL:Macros:multiple-value-bind]] (dummies vals new setter getter) (get-setf-expansion place env) `([[CL:Special Operators:let-star|let*]] (,@([[CL:Functions:mapcar]] #'[[CL:Functions:list]] dummies vals) (,([[CL:Functions:car]] new) ,getter)) ([[CL:Macros:when]] ([[CL:Functions:cdr]] new) ([[CL:Functions:error]] "Can't expand this.")) ([[CL:Macros:prog1]] (car ,([[CL:Functions:car]] new)) ([[CL:Macros:setf]] ,([[CL:Functions:car]] new) ([[CL:Functions:cdr]] ,([[CL:Functions:car]] new))) ,setter)))) ([[CL:Macros:defsetf]] frob (x) (value) `([[CL:Macros:setf]] ([[CL:Functions:car]] ,x) ,value)) → FROB ;;; The following is an error; an error might be signaled at macro expansion time ([[CL:Special Operators:flet]] ((frob (x) ([[CL:Functions:cdr]] x))) ;Invalid (xpop (frob z))) </blockquote> ====Affected By==== None. ====Exceptional Situations==== None. ====See Also==== * **[[CL:Macros:defsetf|Macro DEFSETF]]** * **[[CL:Macros:define-setf-expander|Macro DEFINE-SETF-EXPANDER]]** * **[[CL:Macros:setf|Macro SETF]]** ====Notes==== Any //[[CL:Glossary:compound form]]// is a valid //[[CL:Glossary:place]]//, since any //[[CL:Glossary:compound form]]// whose //[[CL:Glossary:operator]]// //f// has no //[[CL:Glossary:setf expander]]// are expanded into a call to ''(setf //f//)''. \issue{GET-SETF-METHOD-ENVIRONMENT:ADD-ARG} \issue{SETF-METHOD-VS-SETF-METHOD:RENAME-OLD-TERMS} \issue{GET-SETF-METHOD-ENVIRONMENT:ADD-ARG} \issue{GET-SETF-METHOD-ENVIRONMENT:ADD-ARG} \issue{GET-SETF-METHOD-ENVIRONMENT:ADD-ARG}