Commit 8c08fd8b authored by mevenson@1c010e3e-69d0-11dd-93a8-456734b0d56f's avatar mevenson@1c010e3e-69d0-11dd-93a8-456734b0d56f
Browse files

Fixes ticket #199: CL-METHOD failure for &AUX arguments.

DEFGENERIC specified with &AUX arguments now signals an error.

Removed badly conceived BUGS.AUX.1 test which blew up the stack due to
recursively referencing itself in the &AUX init form.
parent 899450d2
......@@ -1403,6 +1403,12 @@
(push item options))))
(setf options (nreverse options)
methods (nreverse methods))
;;; Since DEFGENERIC currently shares its argument parsing with
;;; DEFMETHOD, we perform this check here.
(when (find '&aux lambda-list)
(error 'program-error
:format-control "&AUX is not allowed in a generic function lambda list: ~S"
:format-arguments (list lambda-list)))
`(prog1
(%defgeneric
',function-name
......@@ -1981,8 +1987,13 @@ Initialized with the true value near the end of the file.")
(lambda-list (%generic-function-lambda-list gf))
(exact (null (intersection lambda-list
'(&rest &optional &key
&allow-other-keys &aux)))))
(if exact
&allow-other-keys))))
(no-aux (null (some
(lambda (method)
(find '&aux (std-slot-value method 'sys::lambda-list)))
(sys:%generic-function-methods gf)))))
(if (and exact
no-aux)
(cond
((= number-required 1)
(cond
......
......@@ -115,19 +115,7 @@ Subject: [armedbear-devel] Bug in translate-logical-pathname.
;;; http://trac.common-lisp.net/armedbear/ticket/199
(deftest bugs.clos.aux.1
;;; XXX possible collision with previously defined names
(progn
(defclass room ()
((decorators :reader room-decorators)))
(defgeneric decorators (room))
(defmethod decorators ((room room)
&aux (d (decorators room)))
d)
(decorators (make-instance 'room)))
t)
(deftest bugs.aux.1
(deftest bugs.clos.aux.1
((lambda (a &aux (b (+ a 1)))
b)
2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment