From: Hallvard Tr{tteberg
Subject: class variables
Date: 
Message-ID: <HALTRAET.92Sep30032338@monsun.si.no>
Hi all,

I'm wondering when class variables (slot allocation is :class) are
useful. Certainly I can imagine some uses, but whenever I thought I
wanted to use it, somehow it wasn't quite right. My mental model has
been that class variables are slots in the class metaobject, and that
accessors implicitly looked up the slots in the class metaobject. But
this doesn't quite fit CLOS.

There are two problems I see:

  (1) that you cannot change class variables through the class object,
      you have to have an instance

  (2) that you cannot have something in between class and instance
      slots, e.g. subclass slots, so that different (sub)classes can
      have different class slot values, while all instances of a
      subclass have share the same value.

I would like experienced CLOS programmers to comment on this and share
examples of when class slots have been useful.
(I just found out that if a class slot is mentioned in a subclass
definition, the subclass gets its own class slot, with its own value.
So (2) above seems to be possible. However, I would still like some
comments on use and (1) the problem of (1) is still there)

Hallvard
--
Hallvard Traetteberg
Dept. of Knowledge Based Systems
Center for Industrial Research
Box 124 Blindern, 0314 Oslo 3
NORWAY

Tlf: +47 2 45 29 83 or  +47 2 45 20 10
Fax: +47 2 45 20 40
Email: ···················@si.no