Raymond Toy pushed to branch master at cmucl / cmucl

Commits:

2 changed files:

Changes:

  • src/code/macros.lisp
    --- a/src/code/macros.lisp
    +++ b/src/code/macros.lisp
    @@ -667,7 +667,7 @@
     	  ((and environment
     		(let ((name (car form)))
     		  (dolist (x (c::lexenv-functions environment) nil)
    -		    (when (and (eq (car x) name)
    +		    (when (and (eq (nth-value 1 (valid-function-name-p (car x))) name)
     			       (not (c::defined-function-p (cdr x))))
     		      (return t)))))
     	   (expand-or-get-setf-inverse form environment))
    

  • tests/issues.lisp
    --- a/tests/issues.lisp
    +++ b/tests/issues.lisp
    @@ -73,4 +73,23 @@
       (assert-prints "SQUARE compiler macro present: No.
     
     8"
    -		 (test/present)))
    \ No newline at end of file
    +		 (test/present)))
    +
    +(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))
    +
    +(define-test issue.7
    +    (:tag :issues)
    +  (assert-error 'error
    +		(let ((z (list 1 2)))
    +		  (flet ((frob (x) (cdr x)))
    +		    (xpop (frob z))))))