[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Yeah! I can convert!
- To: info-macl@cambridge.apple.com
- Subject: Yeah! I can convert!
- From: hohmann@valais.csmil.umich.edu
- Date: Wed, 26 Feb 92 17:40:29 -0500
After months of begging/pleading/demanding/etc. I have finally put my
foot down and told my project manager: "I am converting all 29,000+
of 1.3.2 to 2.0, and you can't stop me!!" And, while he is a little
nervous, he knows there is no turning back.
So, hooray for me, but now I find myself learning CLOS as I convert all
this wonderful MCL1.3.2 ObjectLisp code. I am studying the example source
code, and the (simple) question I have is related to the design of methods
for initializing instances of objects. Consider, for example, the code
found on page 503 in the manual. (This is the shapes-code.lisp example).
Looking at the initialize-instance method for the class 'shape-window,
I notice that the first thing this method does is:
(apply #'call-next-method window initargs)
My question is: if the first thing you are going to do is call the
primary methods defined on the 'window class, why not code the
#'initialize-instance method on the 'shape-window class as an :after
method, and then simply remove the call to apply? I believe this
would be both more efficient and conceptually correct, or am I
missing something really important and/or really basic?
Thanks for your replies. I realize that both implementations are
correct, in the sense that both "get the job done", but I am more
interested in learning good CLOS style and writing long-term maintainable
source code. Thanks!
-----------------------------------+--------------------------------------
Luke Hohmann | hohmann@csmil.umich.edu
University of Michigan | 313-763-1043 (Office)
Artificial Intelligence Laboratory | 313-677-0952 (Home)
1101 Beal Ave |
Ann Arbor, MI 48109-2110 | "You should do more aerobics!"