# Re: Clarification

• To: RPG@SAIL.STANFORD.EDU
• Subject: Re: Clarification
• From: Danny Bobrow <Bobrow.pa@Xerox.COM>
• Date: 3 Feb 87 14:34 PST
• Cc: common-lisp-object-system@SAIL.STANFORD.EDU
• In-reply-to: Dick Gabriel <RPG@SAIL.STANFORD.EDU>'s message of 03 Feb 87 13:54 PST
• Sender: Bobrow.pa@Xerox.COM

    We propose the following fair copy:

The slot options provided by the various slot descriptions
combine as follows:

The {\bf :allocation} option is inherited from the most
specific class in the class precedence list. If no superclass
explicitly specifies the {\bf :allocation} option, the default is
{\bf :allocation} {\bf :instance}.''

Note that this definition is intended to be recursive, because
there might be no class that explicitly specifies the :allocation
option.

The only issue this skirts is the following example that has a problem:

(defclass A () ((s :initform 1 :allocation :class)))

(defclass B (A)((s :initform 2)))

The latter MUST mean :allocation :instance (or signal an error).  I
think we should insist that :allocation :class be repeated if it is
intended to change anything else about the class variable (this is the
only sane semantic interpretation).   Another alternative is to make
there be a different class variable in B.

For :dynamic, this kind of example makes sense (there is a different
value stored in a different class).  But on the principle that the
unusual case (namely anything but :allocation :instance) ought to be
visible locally. I would say that if a local description appears in a
class, then allocation is :instance, unless overridden locally.  Or
stronger, if allocation inherited is anything but :instance, then an
error is signalled if no :allocation is specified locally.  Which of
these two do you like?