X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fearly-setf.lisp;h=148721560f562bd32e475ab1e25cdcf128c9edff;hb=b9519773faa7b3c98915eccb9cb1fd8a8270ee56;hp=ee7cc7d84d4edc01f3a062ea17ec4738fb690137;hpb=8bcffb407835ff680d5ee2ba1f7ce97839bbae3e;p=sbcl.git diff --git a/src/code/early-setf.lisp b/src/code/early-setf.lisp index ee7cc7d..1487215 100644 --- a/src/code/early-setf.lisp +++ b/src/code/early-setf.lisp @@ -211,12 +211,14 @@ GET-SETF-EXPANSION directly." (,(car newval) (cons ,g ,getter))) ,setter)))) -(defmacro-mundanely pushnew (obj place &rest keys &environment env) +(defmacro-mundanely pushnew (obj place &rest keys + &key key test test-not &environment env) #!+sb-doc "Takes an object and a location holding a list. If the object is already in the list, does nothing; otherwise, conses the object onto the list. Returns the modified list. If there is a :TEST keyword, this is used for the comparison." + (declare (ignore key test test-not)) (multiple-value-bind (dummies vals newval setter getter) (get-setf-method place env) (let ((g (gensym))) @@ -307,8 +309,9 @@ GET-SETF-EXPANSION directly." "Creates a new read-modify-write macro like PUSH or INCF." (let ((other-args nil) (rest-arg nil) - (env (gensym)) - (reference (gensym))) + (env (make-symbol "ENV")) ; To beautify resulting arglist. + (reference (make-symbol "PLACE"))) ; Note that these will be nonexistent + ; in the final expansion anyway. ;; Parse out the variable names and &REST arg from the lambda list. (do ((ll lambda-list (cdr ll)) (arg nil)) @@ -399,15 +402,15 @@ GET-SETF-EXPANSION directly." (multiple-value-bind (body local-decs doc) (parse-defmacro `(,lambda-list ,@store-variables) whole-var body access-fn 'defsetf + :environment env-var :anonymousp t) `(eval-when (:compile-toplevel :load-toplevel :execute) (assign-setf-macro ',access-fn (lambda (,access-form-var ,env-var) - (declare (ignore ,env-var)) + ,@local-decs (%defsetf ,access-form-var ,(length store-variables) (lambda (,whole-var) - ,@local-decs ,body))) nil ',doc))))))