Changeset 13939


Ignore:
Timestamp:
05/22/12 13:39:13 (12 years ago)
Author:
Mark Evenson
Message:

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.

Location:
trunk/abcl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/clos.lisp

    r13923 r13939  
    14041404    (setf options (nreverse options)
    14051405          methods (nreverse methods))
     1406    ;;; Since DEFGENERIC currently shares its argument parsing with
     1407    ;;; DEFMETHOD, we perform this check here.
     1408    (when (find '&aux lambda-list)
     1409      (error 'program-error
     1410             :format-control "&AUX is not allowed in a generic function lambda list: ~S"
     1411             :format-arguments (list lambda-list)))
    14061412    `(prog1
    14071413       (%defgeneric
     
    19821988            (exact (null (intersection lambda-list
    19831989                                       '(&rest &optional &key
    1984                                          &allow-other-keys &aux)))))
    1985        (if exact
     1990                                         &allow-other-keys))))
     1991            (no-aux (null (some
     1992                           (lambda (method)
     1993                             (find '&aux (std-slot-value method 'sys::lambda-list)))
     1994                           (sys:%generic-function-methods gf)))))
     1995       (if (and exact
     1996                no-aux)
    19861997           (cond
    19871998             ((= number-required 1)
  • trunk/abcl/test/lisp/abcl/bugs.lisp

    r13938 r13939  
    116116
    117117;;; http://trac.common-lisp.net/armedbear/ticket/199
    118 (deftest bugs.clos.aux.1
    119     ;;; XXX possible collision with previously defined names
    120     (progn
    121       (defclass room ()
    122         ((decorators :reader room-decorators)))
    123       (defgeneric decorators (room))
    124       (defmethod decorators ((room room)
    125                              &aux (d (decorators room)))
    126         d)
    127       (decorators (make-instance 'room)))
    128   t)
    129 
    130 (deftest bugs.aux.1
     118(deftest bugs.clos.aux.1
    131119    ((lambda (a &aux (b (+ a 1)))
    132120       b)
Note: See TracChangeset for help on using the changeset viewer.