[Openmcl-devel] check-defmethod-congruency error message

John Wiseman jjwiseman at yahoo.com
Fri Jan 20 01:57:18 UTC 2006


Currently ccl::check-defmethod-congruency reports incongruent lambda
lists like this:

 > Error in process listener(1): Incompatible lambda list in
#<STANDARD-METHOD ADD-DOCUMENT (DOCUMENT-WRITER T)> for
#<STANDARD-GENERIC-FUNCTION ADD-DOCUMENT #x8422EB6>

How about changing it to report this instead:

 > Error in process listener(1): Method #<STANDARD-METHOD ADD-DOCUMENT
(DOCUMENT-WRITER T)> has lambda list (SELF DOC &OPTIONAL ANALYZER)
which is incompatible with generic function's lambda list, (SELF DOC)

It just seems friendlier to show me the current GF lambda list than to
make me hunt down the definition (that I have apparently forgotten or
I might not have made the error in the first place).


John


(defun check-defmethod-congruency (gf method)
   (unless (congruent-lambda-lists-p gf method)
     (cerror (format nil
		    "Remove ~d method~:p from the generic-function and change its  
lambda list."
		    (length (%gf-methods gf)))
	    "Method ~S has lambda list ~S which is incompatible with generic  
function's lambda list, ~S"
	    method (method-lambda-list method) (generic-function-lambda-list  
gf))
     (loop
       (let ((methods (%gf-methods gf)))
         (if methods
           (remove-method gf (car methods))
           (return))))
     (%set-defgeneric-keys gf nil)
     (inner-lfun-bits gf (%ilogior (%ilsl $lfbits-gfn-bit 1)
                                   (%ilogand $lfbits-args-mask
                                             (lfun-bits (%method- 
function method))))))
   gf)




More information about the Openmcl-devel mailing list