Re: Class slots in CLOS



On Dec 31, 5:49 pm, Blake McBride <bl...@xxxxxxxxxxxx> wrote:
Greetings,

It seems to me that there are two ways to define class slots (slots
common to all instances of the class) in CLOS as follows:

1.  via the use of :allocation :class slot option

2.  By the creation and use of a meta-class that is to house the shared
slots for a given class or set of classes.

I suppose my main question is what is the difference.  I'm pretty sure
method #1 is easier to declare and access to the class slots is easier
(just like instance slots).  Is one faster than the other.

I understand that using method #2 is more flexible and theoretically
pure.  Or, is method #1 just a shorthand for method #2?

Why do you say that #2 is "theoretically pure" (whatever that means)?
A problem of #2 is that meta classes don't compose, so I'd choose #1
unless there are specific reasons speaking against it. Then again,
there's nothing wrong with specials either.

Cheers,
Michael

.