[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

``Instance''



In addition to the ``mistake'' Moon found, the following sentences
will need to be examined to see whether they still mean what we
thought they meant:

``The class named {\bf standard-object} is an instance of the class {\bf
standard-class} and is a superclass of every class that is an instance
of {\bf standard-class} except itself.''

``Any class that corresponds to a standard Common Lisp type specified in
{\it Common Lisp: The Language\/} might be an instance of {\bf
built-in-class}.''

``A class that is an instance of {\bf standard-class} can be redefined
if the new class will also be an instance of {\bf standard-class}.''

``\item{\bull} The \OS\ may be extended to support an updating process
when either the old or the new class is an instance of a class other
than {\bf standard-class} that is not a built-in class.''

Moon says that that the CLOS specification ``always carefully uses the
word "instance" in the way I [Moon] just described.''  [Note: he
described ``X is an instance of Y'' as the same as
(eq (class-of X) (find-class Y)).]

This implies that the first of these sentences means:

``The class named {\bf standard-object} is an instance of the class
{\bf standard-class} and is a superclass of every class that is an
instance of {\bf standard-class} except itself. The class {\bf
standard-object} is not an instance of a subclass of {\bf
standard-class}, and it is unspecified whether an instance of a
subclass of {\bf standard-class} is a subclass of {\bf
standard-object}.''

Though this doesn't violate the informal prohibition we have against
subtractive inheritance (since nowhere does it state that such
behavior as is derived from being a subclass of standard-class is
method or structure supported), it seems pointless to imply that this
aspect of gross behavior might not be inherited.

I think we will need to go over the meta-object stuff (chapter 3 of
CLOS) to determine whether places where it currently says (or we think
it says) ``instance'' is meant ``instance of a class or its
subclasses.''

Note that the Smalltalk-80 book seems to define ``instance'' the way
Moon does, but is not very clear about it, nor do they have a word
that corresponds to ``member''. 

I think ``member'' is a very bad word to use for the concept of an
object whose structure (slots) and behavior (methods) correspond to
the specification provided by a class. Common Lisp types correspond
more closely to sets, but CLOS classes have much more structure,
which, to me, implies a different word. 

The definition of ``class'' is as follows:

``A {\bit class\/} object determines the structure and behavior of a set
of other objects, which are called its {\bit instances}.''

[Note that this definition is wrong because it includes the word
``other'' which overly restricts the definition.]

The only set referred to in this definition is the set of instances of
the class; the class itself is not a set, and therefore it is
nonsensical to say that an object is a ``member'' of a non-set.
Moon's proposed rewording (``A structure-object is an instance whose
class is a member of structure-class.'') should be as follows if we
want to use the word ``member'' somehow:

``A structure-object is an instance whose class is a member of the set
of instances of structure-class and its subclasses.''

Besides, if we say ``the object O is a member of the class C,'' some
might believe that (member O C) is a reasonable way to validate the
statement (thinking a class is a sequence).

Since we need to come up with a word to mean ``instance of a class or
its subclasses,'' and since that word should be more commonly used
than the word meaning ``instances of a class but not of its
subclasses,'' why not use ``instance'' for the first and ``direct
instance'' for the second?

			-rpg-