Ignore:
Timestamp:
Oct 9, 2009, 2:46:02 PM (10 years ago)
Author:
gz
Message:

From working-0711 branch: more extensive compile-time checking involving methods/gfs: warn about incongruent lambda lists, duplicate gf defs, required keyword args (from defgeneric), and invalid keyword args in gf calls. Also fix to keep method source files in env function info so dup method warnings can cite the right file.

File:
1 edited

Legend:

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

    r12889 r12940  
    18111811      (append ll '(&allow-other-keys)))))
    18121812
    1813 (defun encode-gf-lambda-list (lambda-list)
    1814   (let* ((bits (encode-lambda-list lambda-list)))
    1815     (declare (fixnum bits))
    1816     (if (logbitp $lfbits-keys-bit bits)
    1817       (logior bits (ash 1 $lfbits-aok-bit))
    1818       bits)))
    1819 
    18201813(defmacro defmethod (name &rest args &environment env)
    18211814  (multiple-value-bind (function-form specializers-form qualifiers lambda-list documentation specializers)
     
    18241817       (eval-when (:compile-toplevel)
    18251818         (record-function-info ',(maybe-setf-function-name name)
    1826                                ',(%cons-def-info 'defmethod (encode-gf-lambda-list lambda-list) nil nil
    1827                                                  specializers qualifiers)
     1819                               ',(multiple-value-bind (bits keyvect) (encode-lambda-list lambda-list t)
     1820                                   (%cons-def-info 'defmethod bits keyvect nil specializers qualifiers))
    18281821                               ,env))
    18291822       (compiler-let ((*nx-method-warning-name* '(,name ,@qualifiers ,specializers)))
     
    21262119         (eval-when (:compile-toplevel)
    21272120           (record-function-info ',(maybe-setf-function-name function-name)
    2128                                  ',(%cons-def-info 'defgeneric (encode-gf-lambda-list lambda-list))
     2121                                 ',(multiple-value-bind (bits keyvect) (encode-lambda-list lambda-list t)
     2122                                     (%cons-def-info 'defgeneric bits keyvect))
    21292123                                 ,env))
    21302124         (let ((,gf (%defgeneric
Note: See TracChangeset for help on using the changeset viewer.