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

Re: CALL-NEXT-METHOD



    Jim Kempf would like to invoke a more general method but not
    specifically the next method via CALL-NEXT-METHOD.
I hadn't understood that this is what Jim wanted.  I thought it was a
misunderstanding of what would happen with 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.
I agree.  If we want to support this feature in the standard (Henry Lieberman
has argued for a facility like this), I think we need a construct more like:

(funcall-qua #'f (the c2 i))

where the funcall-qua is the responsible mechanism for interpreting construct
like "the".

  danny