From: David Pollen
Subject: :after :after
Date: 
Message-ID: <pollenCs4JCI.I4K@netcom.com>
Does CLOS support :after :after methods?  Should it?
What is the easiest way to implement such things?

From: Nichael Cramer
Subject: Re: :after :after
Date: 
Message-ID: <NICHAEL.94Jun28181102@abala.bbn.com>
In article <················@netcom.com> ······@netcom.com (David Pollen) writes:

   From: ······@netcom.com (David Pollen)

   Does CLOS support :after :after methods?
No.

   Should it?
Probably not.  I';d be willing to guess that the power you need to do
what you want is available already.

   What is the easiest way to implement such things?
Probably :AROUND methods.  You can do all the dispatching you
want inside there.

Otherwise if you really want to subtle, something like

(defmethod METHOD-1 :after ((SELF MY-FROB)
  (my-helper-method SELF))

(defmethod MY-HELPER-METHOD :after ((SELF MY-FROB))
  ....)

N
From: Gregor Kiczales
Subject: Re: :after :after
Date: 
Message-ID: <GREGOR.94Jun29100906@calvin.parc.xerox.com>
In article <················@netcom.com> ······@netcom.com (David Pollen) writes:

   Does CLOS support :after :after methods?  Should it?
   What is the easiest way to implement such things?

CLOS includes a very powerful facility to support user-defined method
combination, which can probably do what you want.

But the first question is, what is it you want?  That is, what do you
mean when you say `:after :after' methods.  Can you give an example of
using it?  One thing I can think of is that you want to be able to
have a method on a superclass be `more before' or `more after' a
method on a subclass.  The reason for spending time answering this is
that, as with macros, you're doing a bit of language design here, and,
just was with macros, it is easy to end up with something that isn't
quite what you wanted.

But, assuming that what you want is the more-before more-after stuff I
mentioned, here is an implementation of it, that I wrote by copying
the example definition of standard method combination from the spec
and then editing it slightly.  (I haven't tested this code.)


(define-method-combination more-before-after ()
        ((around (:around))
         (more-before (:more-before))
         (before (:before))
         (primary () :required t)
         (after (:after))
         (more-after (:more-after)))
  (flet ((call-methods (methods)
           (mapcar #'(lambda (method)
                       `(call-method ,method ()))
                   methods)))
    (let ((form (if (or more-before before after more-after (rest primary))
                    `(multiple-value-prog1
                       (progn ,@(call-methods more-before)
                              ,@(call-methods before)
                              (call-method ,(first primary)
                                           ,(rest primary)))
                       ,@(call-methods (reverse after))
                       ,@(call-methods (reverse more-after)))
                    `(call-method ,(first primary) ()))))
      (if around
          `(call-method ,(first around)
                        (,@(rest around)
                         (make-method ,form)))
          form))))
From: Syed Zaeem Hosain
Subject: Re: :after :after
Date: 
Message-ID: <1994Jun30.055628.25286@zcon.com>
In article ···@netcom.com,  ······@netcom.com (David Pollen) writes:
>
>Does CLOS support :after :after methods?  Should it?
>What is the easiest way to implement such things?

Okay. I'll bite. What is an ":after :after" method supposed to do?

I know about regular :after methods, and I always assumed that the
order of these had to be non-critical to make it all work correctly.
Whereas, if I read your question even halfway correctly, you want to
control the order of :after methods execution. Correct?

								Z


-- 
-------------------------------------------------------------------------
| Syed Zaeem Hosain          P. O. Box 610097            (408) 441-7021 |
| Z Consulting Group        San Jose, CA 95161             ···@zcon.com |
-------------------------------------------------------------------------