Changeset 8764


Ignore:
Timestamp:
Mar 13, 2008, 6:32:30 AM (12 years ago)
Author:
gb
Message:

DEFGENERIC, DEFMETHOD: note the lambda list, possibly introducing
&ALLOW-OTHER-KEYS when &KEY is specified.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lib/macros.lisp

    r8489 r8764  
    16801680(defsetf type-predicate set-type-predicate)
    16811681
     1682(defun adjust-defmethod-lambda-list (ll)
     1683  ;; If the lambda list contains &key, ensure that it also contains
     1684  ;; &allow-other-keys
     1685  (if (or (not (memq '&key ll))
     1686          (memq '&allow-other-keys ll))
     1687    ll
     1688    (if (memq '&aux ll)
     1689      (let* ((ll (copy-list ll))
     1690             (aux (memq '&aux ll)))
     1691        (setf (car aux) '&allow-other-keys
     1692              (cdr aux) (cons '&aux (cdr aux)))
     1693        ll)
     1694      (append ll '(&allow-other-keys)))))
     1695
    16821696(defmacro defmethod (name &rest args &environment env)
    16831697  (multiple-value-bind (function-form specializers-form qualifiers lambda-list documentation specializers)
     
    16851699    `(progn
    16861700       (eval-when (:compile-toplevel)
    1687          (note-function-info ',name nil ,env))
     1701         (note-function-info ',name '(lambda ,(adjust-defmethod-lambda-list lambda-list)) ,env))
    16881702       (compiler-let ((*nx-method-warning-name*
    16891703                       (list ',name
     
    19561970      `(progn
    19571971         (eval-when (:compile-toplevel)
    1958            (note-function-info ',function-name nil ,env))
     1972           (note-function-info ',function-name '(lambda ,lambda-list nil) ,env))
    19591973         (let ((,gf (%defgeneric
    19601974                     ',function-name ',lambda-list ',method-combination ',generic-function-class
Note: See TracChangeset for help on using the changeset viewer.