[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
re : call-mathod
- To: firstname.lastname@example.org
- Subject: re : call-mathod
- From: email@example.com (mathieu Lafourcade)
- Date: Sun, 1 Nov 1992 10:57:44 +0100
Ranson <ranson@LANNION.cnet.fr> writes :
>(defclass boat ...)
>(defmethod move-on-sea ((x boat) ...)
>(defmethod move-in-air ((x boat) ...) (error ...)
>(defclass plane ...)
>(defmethod move-on-sea ((x plane) ...) (error ...)
>(defmethod move-in-air ((x plane) ...)
>(defclass hydroplane (boat plane) ...)
>(defmethod move ((x hydroplane) on-sea?)
> (if on-sea?
> (move-on-sea x...)
> (move-in-air x...)))
Ok, it is possible to do that way for a peticular situation.
But *more generally* if boat and plane have been developped separatly and
responds only to the method move, you don't want to assume anything about
the name of the method.
Only the move generic function is defined. It is the same principle with
Some people would like to have something like (call-next-method-of class
<class>) that is exactly (call-next-method) but called for <class>.
As far as I know, the technical problem is that call-next-method is defined
in a flet (in the function that compiles the method ?). And it is not
"open" to further extensions. It is the same for (next-method-p).
It would be REALLY great to have the possibility of extension here. A
function that can define function like call-next-methid and next-method-p
with the current method and the args as implicit arguments.
I really don't khow to do that now as how it could be difficult.
BTW : is it possible to have the sources of MCL ????? (or some part of it)
GETA (Groupe d'Etude pour la Traduction Automatique)
BP 53X, 38041 GRENOBLE CEDEX, FRANCE