[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CLOS changes
> It would be nice to have a one or two page list of all the changes that
> have been made to CLOS since we voted 88-002R. Something that collects
> up, in one place, everything that will be different about what appears
> in the draft standard from 88-002R.
>
> Does one of us already have such a list?
> -------
Here's what I had written for our users:
This section lists changes to the specification that have been adopted by the ANSI
Common Lisp committee since the June 1988 edition of the CLOS specification.
The forms symbol-macrolet, with-slots, and with-accessors will accept
declarations at the beginning of the body. In particular, type declarations may be
given for the variables being defined. For example,
(with-slots (n) object (declare (integer n)) (foo n))
is equivalent to: (foo (the integer (slot-value object 'n))) .
Within the body of symbol-macrolet, with-slots, and with-accessors, the variables
defined can be altered by psetq and multiple-value-setq besides setq and setf.
When the compiler encounters an instance or structure that needs to be written to the
object file as a constant, it calls the generic function make-load-form to find out
what to do. make-load-form is called with the object as its argument; it is expected
to return a form which is to be written to the file and evaluated by the loader to
create the object. In order to handle recursive data structures, two values may be
returned, the first being a form to be evaluated to allocate the object and the second
value being a form to be evaluated to finish initializing the object. The first form
should return the object created; the second form can refer to the object as one of its
arguments; the value returned by the second form is not used. Users can write
methods for make-load-form to enable writing instances of their classes.
Function symbol-function will continue to work only for symbols; to reference the
definition of a (setf ...) function, use function fdefinition.
Functions named (setf symbol) can be defined by defun, flet and labels as well as
by defgeneric, generic-flet and generic-labels.
Instead of making describe a generic function, describe will call the generic
function describe-object with two arguments -- the object and the output stream.
Users can then write methods for describe-object. Note that this parallels the
relationship between print and print-object.
symbol-macrolet has been changed from a macro to a special form. When this
change is made, the second example on page 2-81 will no longer be valid because
macroexpand will expand a symbol defined by symbol-macrolet.