Creation of an Instance

make-instance-expr uses make-atom to make a new symbol and puts in a pointer to the class.

Next, it is necessary to fill in slots and their values. There are some complications here:

  1. An instance can inherit slots not only from its direct superclass, but from higher superclasses as well.

  2. Initialization of the slot may be specified in the call to make-instance using the :initarg names defined for each slot (rather than the name of the slot). If an :initarg value is specified, it is evaluated.

  3. If no :initarg is specified, there may be an :initform given in the slot specification. The :initform must be evaluated, e.g.:
      :initform (get-universal-time))

Contents    Page-10    Prev    Next    Page+10    Index