Re: CLOS question



In article <1185746464.124847.288820@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Scott Burson <FSet.SLB@xxxxxxxxx> wrote:

On Jul 29, 2:27 pm, stam...@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.

This suggests to me that you have analyzed your domain incorrectly.
It would seem that D is not really a subclass of C if you don't want
it to inherit the full behavior of M.

Why that? Each more specific primary method blocks the
less specific primary method. Thus you are not inheriting
the whole functionality. Sure, you can call the next method,
but by default this is not done. Overwriting less specific
functionality is a capability provided for primary
methods. Just not for :before and :after methods. But those
were design decisions for the standard method combination.

Indeed, based on your last
sentence, it sounds like it's the other way around: C is a subclass of
D!

Of course you've left out a lot of information in order to abstract
the problem, so I don't know if this is really correct. But it's the
kind of question I would ask.

-- Scott
.



Relevant Pages

  • Re: CLOS question
    ... Scott Burson writes: ... to define a class d that inherits c, and have instances of d behave ... It would seem that D is not really a subclass of C if you don't want ... in writing some software for part of an AI programming course. ...
    (comp.lang.lisp)
  • Re: class.class = class
    ... So Object and Module are instances of a subclass of themselves, ... inherits from Kernel, which is a Module, a subclass of Object. ... Module is a type of Object that stores Methods. ... Kernel is an *instance* of Module that stores the core methods common to ...
    (comp.lang.ruby)
  • Re: Why do enum values req explicit conversions
    ... The difference is that Form is a subclass of Control. ... underlying enum type. ... > If a class inherits from another class, say Form inherits from control, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: simple-streams
    ... > say I wanted to write a kind of simple-stream that inherits most ... > functionality of an ordinary TCP stream, but it gets an URL and has to ...
    (comp.lang.lisp)
  • Intellisense and COM
    ... A subclass that inherits the baseclass and contains some extra properties and methods ... I use my subclass through COM, ...
    (microsoft.public.dotnet.languages.vb)