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

Re: call-next-method is not a function



Perhaps it is unavoidable, but the possible indefinite extent of the
call-next-method function also exposes another issue, which is whether
identity of the "next method" is closed over, or dynamic.

In the same example, given

(defclass wozzle (nozzle))
(defmethod test ((a wozzle)) #'call-next-method)

(defmethod test ((a nozzle)) "Nozzle tester")

(defvar  *nozzle-tester* (test (make-wozzle))) 

(defclass big-nozzle (nozzle))
(defclass wozzle (big-nozzle))   ; redefines wozzle
(defmethod test ((a big-nozzle)) "Big nozzle tester")

; whew...

(funcall *nozzle-tester*)


Does this get "Nozzle tester" or "Big nozzle tester"? 

The issue is "what's closed over" in the call-next-method. Clearly it
has to close over the identity of the arguments. (All of the arguments.)
Its less clear whether it can somehow cache the identity of the classes
of the arguments, the class of the next argument, or any other
information which was used in the computation of this method. Its also
fairly sticky  about what happens if this method gets removed from the
hierarchy. 

Maybe its ok to leave this unstated, but it seems bothersome.