Re: CLOS question
- From: Rainer Joswig <joswig@xxxxxxxxxxxxxx>
- Date: Sun, 29 Jul 2007 23:43:56 +0200
In article <f8j0o8$8qc$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
stamant@xxxxxxxx (Rob St. Amant) wrote:
I have what seems like a familiar CLOS question, but a quick Google
search doesn't turn up an answer: I have a method, m, and an after
method for it. The after method is specialized on class c. I'd like
to define a class d that inherits c, and have instances of d behave
just like instances of c *except* for that single after method.
I don't believe that I can prevent the after method for class c from
being run when m is called on an instance of d.
Right. All :after methods will be executed.
(Though it would be
convenient if I were wrong about this.) My question is about the
choices for design. I could break class c into two classes, c1 and
c2, and only define the after method for c2, and have d inherit c1,
but I'm wondering if there are other reasonable designs.
Then you get to a more Mixin-style of programming.
Other options:
* use another method combination, maybe write your own one
* put the functionality into a different generic function m1 and
call that from just one :after method.
You can then write different primary methods for m1 and only
the most specific will be called.
.
- Follow-Ups:
- Re: CLOS question
- From: Alan Crowe
- Re: CLOS question
- From: Rob St. Amant
- Re: CLOS question
- References:
- CLOS question
- From: Rob St. Amant
- CLOS question
- Prev by Date: CLOS question
- Next by Date: Re: I symbolics still selling machines? does anyone use the lisp genera os?
- Previous by thread: CLOS question
- Next by thread: Re: CLOS question
- Index(es):