1
Copyright (c) Xerox Corporation 1988. All rights reserved.
4
These notes correspond to the "8/24/88 (beta) AAAI PCL" version of PCL.
6
Please read this entire document carefully.
8
There have been a number of changes since the 8/2/88 version of PCL. As
9
usual, these changes are part of our efforts to make PCL conform with
10
the CLOS specicification (88-002R). This release contains the big
11
changes which the 7/7 through 8/2 releases were really getting ready
14
This version of PCL has been tested at PARC in the following Common
22
Xerox Medley (aka EnvOS Medley)
23
KCL (October 15, 1987)
26
Most of the changes in this version of PCL fall into one of two
29
The first major set of changes makes the order of arguments to setf
30
generic functions and methods conform with the spec. In addition, these
31
changes allow the first argument to defmethod to be of the form (SETF
34
The second major set of changes have to do with slot access and instance
35
structure. Importantly, PCL now checks to see if a slot is bound, and
36
calls slot-unbound if the slot is unbound. This is a major change from
37
previous releases in which slot access just returned NIL for slots which
38
had not yet been set. These changes affect all the functions which
39
access the slots of an instance. In addition, the generic functions
40
which are called by the slot access functions in exceptional
41
circumstances are affected. This set of changes also include the
42
implemenentation of the real initialization protocol as specified by
45
In addition, there are a number of other changes. The most significant
46
of these has to do with the symbols which the PCL package exports by
49
The rest of this document goes on to first describe the slot access
50
changes, then describe the setf generic function changes, and finally
51
describe some of the other minor changes.
53
At the very end of this file is a new section which lists PCL features
54
which are scheduled to disappear in future releases. Please read this
55
section and take it to heart. This features will be disappearing.
58
*** Changes to slot access and instance structure ***
60
This release includes a number of changes to the way slot access works
61
in PCL. Some of these changes are incompatible with old behavior. Code
62
which was written with the actual CLOS spec in mind should not be
63
affected by these incompatible changes, but some older code may be
66
The basic thrust of the changes to slot access is to bring the following
67
functions and generic functions in line with the specification:
76
slot-boundp-using-class
77
slot-exists-p-using-class
78
slot-makunbound-using-class
79
slot-value-using-class
82
(setf slot-value-using-class)
85
make-instances-obsolete
87
make-instance (temporarily called *make-instance)
88
initialize-instance (temporarily called *initialize-instance)
90
update-instance-for-different-class
91
update-instance-for-redefined-class
94
In this release, these functions accept the specified number of
95
arguments, return the specified values, have the specified effects, and
96
are called by the rest of PCL in the specified way at the specified
97
times (with the exception that PCL does not yet call *make-instance to
98
create its own metaobjects). Because PCL now checks for unbound slots,
99
you may notice a slight performance degradation in certain applications.
101
For complete information, you should of course see the CLOS specification.
102
The rest of this note is a short summary of how this new behavior is
103
different from the last release.
105
- Dynamic slots are no longer supported. Various functions like
106
slot-value-always and remove-slot no longer exist. Also,
107
slot-value-using-class now only accepts the three arguments as
108
described in the spec. The two extra arguments having to do with
109
dynamic slots are no longer accepted.
111
Shortly, we will release a metaclass which provides the now missing
112
dynamic slot behavior.
114
- slot-missing now receives and accepts different arguments.
116
- slot-unbound is now implemented, and is called at the appropriate
119
- the initialization protocol specified in 88-002R is now almost
120
completely implemented. The only difference is that the current
121
implementation does not currently check the validity of initargs.
122
So, no errors are signalled in improper initargs are supplied.
124
Because of name conflicts with the two other initialization protocols
125
PCL currently supports, some of the specified initialization functions
126
do not have their proper name. The mapping between names in the
127
specification and names in this version of PCL is as follows:
131
make-instance *make-instance
132
initialize-instance *initialize-instance
133
reinitialize-instance <has proper name>
134
update-instance-for-different-class <has proper name>
135
update-instance-for-redefined-class <has proper name>
136
shared-initialize <has proper name>
139
In a future release of PCL, these functions will have their proper
140
names, and all the old, obsolete initialization protocols will
143
Convert to using this new wonderful initialization protocol soon.
145
Sometime soon we will release a version of PCL which does significant
146
optimization of calls to make-instance. This should speed up instance
147
creation dramatically, which should significantly improve the
148
performance of some programs.
150
- The function all-slots no longer exists. There is a new generic
151
function called slots-to-inspect, which controls the default behavior
152
of describe. It also controls the default behavior of the inspector
153
in ports which have connected their inspectors to PCL. It specifies
154
which slots of a given class should be inspected. See the definition
155
in the file high.lisp for more.
157
- the metaclass obsolete-class no longer exists. The mechanism by which
158
instances are marked as being obsolete is now internal, as described
159
in the spec. The generic-function make-instances-obsolete can be used
160
to force the instances of a class to go through the obsolete instance
161
update protocol (see update-instance-for-redefined-class).
163
- all-std-class-readers-miss-1, a generic function which was part of
164
the database interface code I sent out a few weeks ago, has a slightly
165
different argument list. People using the code I sent out a few weeks
166
ago should replace the definition there with:
168
(defmethod all-std-class-readers-miss-1
169
((class db-class) wrapper slot-name)
170
(declare (ignore wrapper slot-name))
173
- The implementation of the slot access generic functions have been
174
considerably streamlined. The impenetrable macrology which used to be
177
- Because the behavior of the underlying slot access generic functions
178
has changed, it is possible that some user code which hacks the
179
underlying instance structure may break. Most of this code shouldn't
180
break though. There have been some questions on the mailing list
181
about what is the right way to modify the structure of an instance.
182
I am working on that section of chapter 3 right now, and will answer
183
those questions sometime soon.
186
*** Changes to SETF generic functions ***
188
This release of PCL includes a significant change related to the order
189
of arguments of setf generic functions. To most user programs, this
190
change should be invisible. Your program should run just fine in the
191
new version of PCL. Even so, there is some conversion you should do to
192
your program, since DEFMETHOD-SETF is now obsolete and will be going
195
Some programs may take some work to adapt to this change. This will
196
be particularly true of programs which manipulated methods for setf
197
generic-functions using make-instance, add-method and friends.
199
Included here is a brief overview of this change to PCL. Most people
200
will find that this is all they need to know about this change.
202
The CLOS specification assumes a default behavior for SETF in the
203
absence of any defsetf or define-modify-macro. The default behavior is
204
to expand forms like:
210
(FUNCALL #'(SETF FOO) a x y)
212
The key point is that by default, setf expands into a call to a function
213
with a well-defined name, and that in that call, the new value argument
214
comes before all the other arguments.
216
This requires a change in PCL, because previously, PCL arranged for the
217
new-value argument to be the last required argument. This change
218
affects the way automatically generated writer methods work, and the way
219
that defmethod with a first argument of the form (SETF <symbol>) works.
221
An important point is that I cannot implement function names of the form
222
(SETF <symbol>) portably in PCL. As a result, in PCL, I am using names
223
of the form |SETF FOO|. Note that the symbol |SETF FOO| is interned in
224
the home package of the symbol FOO. (See the description of the
225
GET-SETF-FUNCTION and GET-SETF-FUNCTION-NAME).
228
The user-visible changes are:
230
- DEFMETHOD will accept lists of the form (SETF FOO) as a first
231
argument. This will define methods on the generic function named
232
by the symbol |SETF FOO|. As specified in the spec, these methods
233
should expect to receive the new-value as their first argument.
234
Calls to defmethod of this form will also arrange for SETF of FOO to
235
expand into an appropriate call to |SETF FOO|.
237
- Automatically generated writer methods will expect to receive the new
238
value as their first argument.
240
- DEFMETHOD-SETF will also place the new-value as the first argument.
241
This is for backward compatibility, since defmethod-setf itself will
242
be obsolete, and you should convert your code to stop using it.
244
- GET-SETF-FUNCTION is a function which takes a function name and
245
returns the setf function for that function if there is one. Note
246
that it doesn't take an environment argument. Note that this function
247
is not specified in Common Lisp or CLOS. PCL will continue to support
248
it as an extra export indefinetely.
250
- GET-SETF-FUNCTION-NAME is a function which takes a function name
251
and returns the symbol which names the setf function for that
252
function. Note that this function is not specified in Common Lisp
253
or CLOS. PCL will continue to support it as an extra export
256
- For convenience, PCL defines a macro called DO-STANDARD-DEFSETF which
257
can be used to do the appropriate defsetf. This may be helpful for
258
programs which have calls to setf of a generic-function before any
259
of the generic function's method definitions. A use of this macro
262
(do-standard-defsetf position-x)
264
Afterwards, a form like (SETF (POSITION-X P) V) will expand into a
265
form like (|SETF POSITION-X| V P).
267
The reason you may have to use do-standard-defsetf is that I cannot
268
portably change every implementations SETF to have the new default
269
behavior. The proper way to use this is to take an early file in
270
your system, and put a bunch of calls to do-standard-defsetf in it.
271
Note that as soon as PCL sees a defmethod with a name argument of
272
the form (SETF FOO), or it sees a :accessor in a defclass, it will
273
do an appropriate do-standard-defsetf for you.
276
In summary, the only things that will need to be changed in most
277
programs is that uses of defmethod-setf should be converted to
278
appropriate uses of defmethod.
280
Here is an example of a typical user program which is affected by this
283
(defclass position ()
284
((x :initform 0 :accessor pos-x)
285
(y :initform 0 :accessor pos-y)))
287
(defclass monitored-position (position)
290
(defmethod-setf pos-x :before ((p monitored-position)) (new)
291
(format *trace-output* "~&Changing x coord of ~S to ~D." p new))
293
(defmethod-setf pos-y :before ((p monitored-position)) (new)
294
(format *trace-output* "~&Changing y coord of ~S to ~D." p new))
297
To bring this program up to date, you should convert the two
298
defmethod-setf forms as follows:
300
(defmethod (setf pos-x) :before (new (p monitored-position))
301
(format *trace-output* "~&Changing x coord of ~S to ~D." p new))
303
(defmethod (setf pos-y) :before (new (p monitored-position))
304
(format *trace-output* "~&Changing y coord of ~S to ~D." p new))
307
*** Other changes in this release ***
309
* The symbols exported by the PCL package have now changed. The PCL
310
package now exports the symbols listed in the table of contents of
311
chapter 2 of the spec. This list of symbols is the value of the
312
variable pcl::*exports*.
314
Following is the list of symbols which were exported in the 8/2/88
315
version but which are not exported in the 8/18/88 version.
317
DEFMETHOD-SETF DEFGENERIC-OPTIONS DEFGENERIC-OPTIONS-SETF
318
CLASS-CHANGED CLASS-NAMED SYMBOL-CLASS
319
CBOUNDP GET-METHOD GET-SETF-GENERIC-FUNCTION
322
Following is the list of symbols which are exported in the 8/18/88
323
version, but which were not exported in previous versions:
325
CALL-METHOD CLASS-NAME COMPUTE-APPLICABLE-METHODS
326
DEFGENERIC ENSURE-GENERIC-FUNCTION FIND-METHOD
327
FUNCTION-KEYWORDS GENERIC-FLET GENERIC-LABELS
328
INITIALIZE-INSTANCE MAKE-INSTANCES-OBSOLETE NO-APPLICABLE-METHOD
329
NO-NEXT-METHOD REINITIALIZE-INSTANCE SHARED-INITIALIZE
330
SLOT-BOUNDP SLOT-EXISTS-P SLOT-MAKUNBOUND
331
SLOT-MISSING SLOT-UNBOUND SYMBOL-MACROLET
332
UPDATE-INSTANCE-FOR-DIFFERENT-CLASS
333
UPDATE-INSTANCE-FOR-REDEFINED-CLASS
336
It should be noted that not all of these newly exported symbols have
337
been "implemented" yet.
340
* Any program written using PCL will need to be completely recompiled
341
to run with this release of PCL.
343
* The generic-function generic-function-pretty-arglist now returns a
344
nice arglist for any generic function. It combines all the keyword
345
arguments accepted by the methods to get the combined set of keywords.
346
In some ports, the environment specific ARGLIST function has been
347
connected to this, and so the environments will print out nice arglists
348
for generic functions.
350
* Some bugs in trace-method have been fixed. Trace-method should now
351
work in all ports of PCL.
353
* NO-MATCHING-METHOD has been renamed to NO-APPLICABLE-METHOD. In
354
addition, it now receives arguments as specified.
356
* defmethod has been modified to allow macros which expand into
359
* The :documentation slot option is now accepted in defclass forms. The
360
documentation string put here cannot yet be retrieved using the
361
documentation function. That will happen in a later release.
363
* The :writer slot option is now implemented.
365
* Some brain damage in high.lisp which caused method lookup to work
366
incorrectly for built in classes. In addition, it caused the
367
class-local-supers and class-direct-subclasses of the built in classes
368
to be strange. People using CLOS browsers should notice this change
369
dramatically, as it will make the browse of the built in part of the
370
class lattice look right.
373
*** Older Changes ***
375
Following are changes which appeared in release of PCL from 7/7/88 to
376
8/2/88. Each change is marked with the release it appeared in.
381
Loading defclass forms should be much faster now. The bug which caused
382
all the generic functions in the world to be invalidated whenever a
383
class was defined has now been fixed.
385
Loading defmethod forms should also be much faster. A bug which caused
386
a tremendous amount of needles computation whenever a method was also
392
A bug which caused several slots of the classes T, OBJECT, CLASS and
393
STANDARD-CLASS to be unbound has been fixed.
398
load-pcl now adds the symbols :PCL and :PORTABLE-COMMONLOOPS to
401
PCL still doesn't do any sort of call to PROVIDE because of the total
402
lack of uniformity in the behavior of require and provide in the various
403
common lisp implementations.
407
This version of PCL finally fixes the horrible bug that prevented
408
the initform for :class allocation slots from being evaluated when the
413
PCL now converts the function describe into a generic function of one
414
argument. This is to bring it into conformance with the spec as
417
In Symbolics Genera, it is actually a function of one required and one
418
optional argument. This is because the 3600 sometimes calls describe
419
with more than one argument.
421
In Lucid Lisp, describe only takes an optional argument. This argument
422
defaults to the value of *. PCL converts describe to a generic function
423
of one required argument so it is not possible to call describe with
428
class-named and symbol-class have been replaced by find-class.
429
find-class is documented in 88-002R.
433
with-slots and with-accessors now conform to 88-002R.
435
The old definition of with-slots is now called obsolete-with-slots. The
436
same is true for with-accessors.
438
with-slots ---> obsolete-with-slots
439
with-accessors --> obsolete-with-accessors
441
The temporary correct definition of with-slots, with-slots* is now
442
called with-slots. The same is true for with-accessors*.
444
with-slots* --> with-slots
445
with-accessors* -> with-accessors
449
The class-precedence list of the class null now conforms to 88-002R.
451
In previous releases of PCL, the class precedence-list of the class
452
null was: (null list symbol sequence t). In this release the class
453
precedence list of the class null is: (null symbol list sequence t).
455
This change was made to bring PCL into conformance with the spec.
461
print-object now takes only two arguments.
463
This changes was made to begin bringing print-object in conformance with
464
88-002R. print-object conforms to the spec to the extent that is is
465
called at the approrpiate times for PCL instances. In most
466
implementations, it is not called at the appropriate times for other
467
instances. This is not under my control, encourage your vendor to
468
provide the proper support for print-object.
472
This version of PCL now includes a beta test version of a new iteration
473
package. This iteration package was designed by Pavel Curtis and
474
implemented by Bill vanMelle. This iteration package is defined in the
475
file iterate.lisp. Please feel free to experiment with it. We are all
476
very interested in comments on its use.
480
*** PCL Features that will be disappearing ***
482
This section describes features in PCL that will be disappearing in
483
future releases. For each change, I try to give a release date after
484
which I will feel free to remove this feature. This list should not be
485
considered complete. Certain other PCL features will disappear as well.
486
The items on this list are the user-interface level items that it is
487
possible to give a lot of warning about. Other changes will have more
488
subtle effects, for example when the lambda-list congruence rules are
491
- :accessor-prefix in defclass
493
Can disappear anytime after 8/29.
495
Warning that this is obsolete has been out for some time. You should
496
use :accessor in each of the slot specifications of the defclass form.
497
It is true that this is slightly more cumbersome, but the semantic
498
difficulties associated with :accesor-prefix are even worse.
500
- :constructor in defclass
502
Can disappear anytime after 8/29.
504
Warning that this is obsolete has been out for some time. It will be
505
disappearing shortly because the intialization protocol which it goes
506
with will be disappearing. A future release of PCL will support a
507
special mechanism for defining functions of the form:
509
(defun make-foo (x y &optional z)
510
(make-instance 'foo 'x x :y y :z z))
512
In the case where there are only :after methods on initialize-instance
513
and shared-initialize, these functions will run like the wind. We hope
514
to release this facility by 9/15.
516
- old definition of make-instance, intialize, initialize-from-defaults,
517
initialize-from-init-plist
519
Can disappear anytime after 8/29.
521
Convert to using the new initialization protocol as described in the
524
- mki, old definition of initialize-instance
526
Can disappear anytime after 8/29.
528
Convert to using the new initialization protocol as described in the
533
Can disappear anytime after 9/15.
535
Convert to using (defmethod (setf foo) ...