Article View: comp.lang.clos
Article #475How to get class slots with an instance at each class
From: Joe Konstan
Date: Tue, 02 Apr 1991 23:07
Date: Tue, 02 Apr 1991 23:07
25 lines
1242 bytes
1242 bytes
Is there an easy way to accomplish the following:
(Assume I have a typical inheritance tree as follows:
A
/ \
Aa Ab etc.
/ \ \
Aa1 Aa2 Ab1
I want to define a slot named "default" that is a class slot for all of these
classes but has a separate value in each class. In other words, I want
(defclass A ()
((default :allocation :class :initform 10 ...)
...))
but also want each subclass to have its own slot named default that can
be changed separately.
I know this can be done by adding a new slot definition in the defclass for
each subclass, but this is undesirable (for several reasons). Is there an
alternative?
Joe Konstan
Technical Details
Message-ID:
<41558@ucbvax.BERKELEY.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!elmer-fudd.berkeley.edu!konstanShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!elmer-fudd.berkeley.edu!konstan From: konstan@elmer-fudd.berkeley.edu (Joe Konstan) Newsgroups: comp.lang.clos Subject: How to get class slots with an instance at each class Message-ID: <41558@ucbvax.BERKELEY.EDU> Date: 2 Apr 91 23:07:05 GMT Sender: nobody@ucbvax.BERKELEY.EDU Reply-To: konstan@elmer-fudd.berkeley.edu (Joe Konstan) Organization: Picasso Research Group, UC Berkeley CS Division Lines: 25