Re: CLOS question
- From: Kent M Pitman <pitman@xxxxxxxxxxx>
- Date: 30 Jul 2007 23:15:11 -0400
Barry Margolin <barmar@xxxxxxxxxxxx> writes:
IMHO, :BEFORE and :AFTER methods were created primarily to support the
mixin style of OO programming. If you don't want to inherit these
methods, you simply don't mix the parent class into your class.
That's a reasonable point of view, certainly. Though often the
problem is with some particular method and that can mean giving up an
awful lot of other stuff you don't want to give up.
I've personally found this inability to refine or enhance an inherited
:after or :before method a pain, and I wanted to just say so lest
someone think they were irrational for being annoyed. It's sometimes
indeed a pain ... even though it's also equally possible for someone
writing a method to take some comfort in your lack of easy ability to
overcome their method. It's a kind of "unstoppable force meets
impenetrable barrier" problem, with arguments on both sides.
It seems to me, though I haven't tried, that it would be possible to
write a method combination that worked differently, perhaps allowing a
:shadowed-after qualifier that, if used, would cause the inherited
:after methods to appear only under a call-next-method. Or perhaps
a complementary tactic: just using :after but providing a way to do
(skip-next-method) or (skip-next-methods n) or something like that.
Maybe skipping :before or :after methods will accidentally fail to do
important stuff, but then, so does failing to call call-next-method if
all the computation is being done in the primary, and people mostly
work that out... each paradigm trades off the issues of functionality,
safety, convenience, modularity, etc. in different ways.
I see no reason for someone not to try something like that out, and
advertise it for others to use if they find they get something that
feels good. The language is full of opportunities to experiment with
things like this.
.
- References:
- CLOS question
- From: Rob St. Amant
- Re: CLOS question
- From: Scott Burson
- Re: CLOS question
- From: Rainer Joswig
- Re: CLOS question
- From: Barry Margolin
- CLOS question
- Prev by Date: Re: CFFI tests problem
- Next by Date: Re: script solution in common lisp
- Previous by thread: Re: CLOS question
- Next by thread: Re: CLOS question
- Index(es):
Relevant Pages
|
|