[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CALL-NEXT-METHOD
- To: common-lisp-object-system@SAIL.Stanford.EDU
- Subject: CALL-NEXT-METHOD
- From: Dick Gabriel <RPG@SAIL.Stanford.EDU>
- Date: 07 Jan 88 1055 PST
Jim Kempf would like to invoke a more general method but not specifically
the next method via CALL-NEXT-METHOD.
This could be done by invoking the generic function again if there were
some way to tell CLASS-OF to consider that instances of class C1 are
instances of a superclass C2 or if there were some linguistic means of
indicating this at generic function invocation time. That is, if C2 is
a superclass of C1 and I1 is an instance of C1, then one could invoke a
more general method if you could specifiy that I1 should be considered a
direct instance of C2 (assuming C2 is the correct level of generality).
For instance,
(defmethod f ((c c1)) 'c1)
(defmethod f ((c c2)) 'c2)
(setq i (make-instance 'c1))
(f i) => c1
(f (the c2 i)) => c2
However, CALL-NEXT-METHOD does not seem the proper mechanism for
this.
-rpg-