[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: no-applicable-method



	(no-applicable-method generic-function first-argument &rest
	all-arguments)

    This all looks fine except for what I think is a bug in the example.

I thought we already changed the definition from

(defgeneric no-applicable-method (generic-function first-argument
				  &rest all-arguments))
to

(defgeneric no-applicable-method (generic-function all-arguments))


I agree.  One must redefine no-applicable-method to call another generic
function that is specialized on the first argument. 

(defmethod no-applicable-method (generic-function all-arguments)
   (forward-message (car all-arguments) *elsewhere*
     (list generic-function all-arguments)))

where the forwarder type understands the method forward-message, and no
other.

Alternatively, no-applicable-method could search the argument list for
an element of the forwarder class to send the message to, else signal an
error.  This would not make it so dependent on the first argument.