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

changes to slot access



The next release of PCL is gearing up to be a good one.  Good in the
sense that we will be making significant progress towards conforming
with the CLOS specification (88-002R).  In addition to the previously
announced changes related to setf generic functions, this release will
include a number of changes related to the way slot access works.  This
message gives some advance description of these changes.

The information in this message will be repeated in the release notes,
but I suggest you spend some time reading it now.  We are currently in
the process of testing the changes we made (hard to believe isn't it), I
expect the actual release will be sometime in the next couple of days.

Some of the changes described in this message are incompatible.  The old
behavior of some of the slot access functions has changed incompatibly.
Code which was written with the actual CLOS spec in mind should not be
affected by these incompatible changes, but some older code may be
affected.

The basic thrust of the changes to slot access is to bring the following
functions and generic functions in line with the specification:

   slot-boundp
   slot-exists-p
   slot-makunbound
   slot-missing      
   slot-unbound
   slot-value     

   slot-boundp-using-class
   slot-exists-p-using-class
   slot-makunbound-using-class
   slot-value-using-class

   (setf slot-value)
   (setf slot-value-using-class)

   change-class
   make-instances-obsolete

   make-instance (temporarily called *make-instance)
   initialize-instance (temporarily called *initialize-instance)
   reinitialize-instance
   update-instance-for-different-class
   update-instance-for-redefined-class
   shared-initialize

In this new release, these functions accept the specified number of
arguments, return the specified values, have the specified effects, and
are called by the rest of PCL in the specified way at the specified
times (with the exception that PCL does not yet call *make-instance to
create its own metaobjects).  Because PCL now checks for unbound slots,
you may notice a slight performance degradation in certain applications.

For complete information, you should of course see the CLOS specification.
The rest of this note is a short summary of how this new behavior is
different from the last release.

- Dynamic slots are no longer supported.  Various functions like
  slot-value-always and remove-slot no longer exist.  Also,
  slot-value-using-class now only accepts the three arguments as
  described in the spec.  The two extra arguments having to do with
  dynamic slots are no longer accepted.

  Shortly, we will release a metaclass which provides the now missing
  dynamic slot behavior.

- slot-missing now receives and accepts different arguments.

- slot-unbound is now implemented, and is called at the appropriate
  times.

- the metaclass obsolete-class no longer exists.  The mechanism by which
  instances are marked as being obsolete is now internal, as described
  in the spec.  The generic-function make-instances-obsolete can be used
  to force the instances of a class to go through the obsolete instance
  update protocol (see update-instance-for-redefined-class).

- all-std-class-readers-miss-1, a generic function which was part of
  the database interface code I sent out a few weeks ago, has a slightly
  different argument list.  People using the code I sent out a few weeks
  ago should replace the definition there with:

  (defmethod all-std-class-readers-miss-1
	     ((class db-class) wrapper slot-name)
    (declare (ignore wrapper slot-name))
    ())

- The implementation of the slot access generic functions have been
  considerably streamlined.  The impenetrable macrology which used to be
  used is now gone.

- Because the behavior of the underlying slot access generic functions
  has changed, it is possible that some user code which hacks the
  underlying instance structure may break.  Most of this code shouldn't
  break though.  There have been some questions on the mailing list
  about what is the right way to modify the structure of an instance.
  I am working on that section of chapter 3 right now, and will answer
  those questions sometime soon.
-------