improve the SB-EXT:GC docstring(s)
[sbcl.git] / src / pcl / generic-functions.lisp
1 ;;;; Mostly this file contains generic functions. The exceptions are hacks.
2
3 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; more information.
5
6 ;;;; This software is in the public domain and is provided with absolutely no
7 ;;;; warranty. See the COPYING and CREDITS files for more information.
8
9 (in-package "SB-PCL")
10 \f
11 ;;;; class predicates
12
13 (defgeneric class-eq-specializer-p (object))
14
15 (defgeneric classp (object))
16
17 (defgeneric condition-class-p (object))
18
19 (defgeneric eql-specializer-p (object))
20
21 (defgeneric exact-class-specializer-p (object))
22
23 (defgeneric forward-referenced-class-p (object))
24
25 (defgeneric funcallable-standard-class-p (object))
26
27 (defgeneric generic-function-p (object))
28
29 (defgeneric method-combination-p (object))
30
31 (defgeneric method-p (object))
32
33 (defgeneric short-method-combination-p (object))
34
35 (defgeneric slot-class-p (object))
36
37 (defgeneric specializerp (object))
38
39 (defgeneric standard-accessor-method-p (object))
40
41 (defgeneric standard-boundp-method-p (object))
42
43 (defgeneric standard-class-p (object))
44
45 (defgeneric standard-generic-function-p (object))
46
47 (defgeneric standard-method-p (object))
48
49 (defgeneric standard-reader-method-p (object))
50
51 (defgeneric standard-writer-method-p (object))
52
53 (defgeneric structure-class-p (object))
54 \f
55 ;;;; readers
56
57 (defgeneric accessor-method-slot-definition (standard-accessor-method))
58
59 (defgeneric class-can-precede-list (pcl-class))
60
61 (defgeneric class-defstruct-constructor (structure-class))
62
63 (defgeneric class-defstruct-form (structure-class))
64
65 (defgeneric class-direct-subclasses (class))
66
67 (defgeneric class-direct-superclasses (class))
68
69 (defgeneric class-eq-specializer (class))
70
71 (defgeneric class-incompatible-superclass-list (pcl-class))
72
73 (defgeneric class-name (class))
74
75 (defgeneric class-precedence-list (pcl-class))
76
77 (defgeneric class-wrapper (pcl-class))
78
79 (defgeneric definition-source (definition-source-mixin))
80
81 (defgeneric eql-specializer-object (eql-specializer))
82
83 (defgeneric generic-function-declarations (standard-generic-function))
84
85 (defgeneric generic-function-method-class (standard-generic-function))
86
87 (defgeneric generic-function-method-combination (standard-generic-function))
88
89 (defgeneric generic-function-methods (standard-generic-function))
90
91 (defgeneric generic-function-name (standard-generic-function))
92
93 (defgeneric gf-arg-info (standard-generic-function))
94
95 (defgeneric gf-dfun-state (standard-generic-function))
96
97 (defgeneric generic-function-initial-methods (standard-generic-function))
98
99 (defgeneric long-method-combination-function (long-method-combination))
100
101 (defgeneric method-combination-documentation (standard-method-combination))
102
103 (defgeneric method-combination-options (standard-method-combination))
104
105 (defgeneric method-combination-type-name (standard-method-combination))
106
107 (defgeneric method-generic-function (standard-method))
108
109 (defgeneric object-plist (plist-mixin))
110
111 (defgeneric short-combination-identity-with-one-argument
112   (short-method-combination))
113
114 (defgeneric short-combination-operator (short-method-combination))
115
116 (defgeneric slot-definition-class (slot-definition))
117
118 (defgeneric slot-definition-defstruct-accessor-symbol
119   (structure-slot-definition))
120
121 (defgeneric slot-definition-initargs (slot-definition))
122
123 (defgeneric slot-definition-initform (slot-definition))
124
125 (defgeneric slot-definition-initfunction (slot-definition))
126
127 (defgeneric slot-definition-internal-reader-function
128   (structure-slot-definition))
129
130 (defgeneric slot-definition-internal-writer-function
131   (structure-slot-definition))
132
133 (defgeneric slot-definition-location (standard-effective-slot-definition))
134
135 (defgeneric slot-definition-name (slot-definition))
136
137 (defgeneric slot-definition-info (effective-slot-definition))
138
139 (defgeneric slot-definition-readers (slot-definition))
140
141 (defgeneric slot-definition-type (slot-definition))
142
143 (defgeneric slot-definition-writers (slot-definition))
144
145 (defgeneric specializer-object (class-eq-specializer))
146
147 (defgeneric specializer-type (specializer))
148 \f
149 ;;;; writers
150
151 (defgeneric (setf class-defstruct-constructor) (new-value structure-class))
152
153 (defgeneric (setf class-defstruct-form) (new-value structure-class))
154
155 (defgeneric (setf class-direct-slots) (new-value slot-class))
156
157 (defgeneric (setf class-incompatible-superclass-list) (new-value pcl-class))
158
159 (defgeneric (setf class-name) (new-value class))
160
161 (defgeneric (setf class-slots) (new-value slot-class))
162
163 (defgeneric (setf generic-function-method-class) (new-value
164                                                   standard-generic-function))
165
166 (defgeneric (setf generic-function-method-combination)
167   (new-value standard-generic-function))
168
169 (defgeneric (setf generic-function-declarations) (new-value
170                                                   standard-generic-function))
171
172 (defgeneric (setf generic-function-methods) (new-value
173                                              standard-generic-function))
174
175 (defgeneric (setf generic-function-name) (new-value standard-generic-function))
176
177 (defgeneric (setf gf-dfun-state) (new-value standard-generic-function))
178
179 (defgeneric (setf generic-function-initial-methods)
180   (new-value standard-generic-function))
181
182 (defgeneric (setf method-generic-function) (new-value standard-method))
183
184 (defgeneric (setf object-plist) (new-value plist-mixin))
185
186 (defgeneric (setf slot-definition-allocation) (new-value
187                                                standard-slot-definition))
188
189 (defgeneric (setf slot-definition-class) (new-value slot-definition))
190
191 (defgeneric (setf slot-definition-defstruct-accessor-symbol)
192   (new-value structure-slot-definition))
193
194 (defgeneric (setf slot-definition-initargs) (new-value slot-definition))
195
196 (defgeneric (setf slot-definition-initform) (new-value slot-definition))
197
198 (defgeneric (setf slot-definition-initfunction) (new-value slot-definition))
199
200 (defgeneric (setf slot-definition-internal-reader-function)
201   (new-value structure-slot-definition))
202
203 (defgeneric (setf slot-definition-internal-writer-function)
204   (new-value structure-slot-definition))
205
206 (defgeneric (setf slot-definition-location)
207   (new-value standard-effective-slot-definition))
208
209 (defgeneric (setf slot-definition-name) (new-value slot-definition))
210
211 (defgeneric (setf slot-definition-info) (new-value effective-slot-definition))
212
213 (defgeneric (setf slot-definition-readers) (new-value slot-definition))
214
215 (defgeneric (setf slot-definition-type) (new-value slot-definition))
216
217 (defgeneric (setf slot-definition-writer-function)
218   (new-value effective-slot-definition))
219
220 (defgeneric (setf slot-definition-writers) (new-value slot-definition))
221 \f
222 ;;;; 1 argument
223
224 (defgeneric accessor-method-slot-name (m))
225
226 (defgeneric class-default-initargs (class))
227
228 (defgeneric class-direct-default-initargs (class))
229
230 (defgeneric class-direct-slots (class))
231
232 (defgeneric class-finalized-p (class))
233
234 (defgeneric class-prototype (class))
235
236 (defgeneric class-slot-cells (class))
237
238 (defgeneric class-slots (class))
239
240 (defgeneric compute-class-precedence-list (root))
241
242 (defgeneric compute-default-initargs (class))
243
244 (defgeneric compute-discriminating-function (gf))
245
246 (defgeneric compute-discriminating-function-arglist-info (generic-function))
247
248 (defgeneric compute-slots (class))
249
250 (defgeneric finalize-inheritance (class))
251
252 (defgeneric function-keywords (method))
253
254 (defgeneric function-keyword-parameters (method))
255
256 (defgeneric generic-function-argument-precedence-order (gf))
257
258 (defgeneric generic-function-lambda-list (gf))
259
260 (defgeneric generic-function-pretty-arglist (generic-function))
261
262 (defgeneric gf-fast-method-function-p (gf))
263
264 (defgeneric initialize-internal-slot-functions (slotd))
265
266 (defgeneric make-instances-obsolete (class))
267
268 (defgeneric method-function (method))
269
270 (defgeneric method-lambda-list (m))
271
272 (defgeneric method-qualifiers (m))
273
274 (defgeneric method-specializers (m))
275
276 (defgeneric raw-instance-allocator (class))
277
278 (defgeneric slot-definition-allocation (slotd))
279
280 (defgeneric slots-fetcher (class))
281
282 (defgeneric specializer-class (specializer))
283
284 (defgeneric specializer-direct-generic-functions (specializer))
285
286 (defgeneric specializer-direct-methods (specializer))
287
288 (defgeneric specializer-method-table (specializer))
289
290 (defgeneric update-constructors (class))
291
292 (defgeneric wrapper-fetcher (class))
293 \f
294 ;;;; 2 arguments
295
296 (defgeneric add-dependent (metaobject dependent))
297
298 (defgeneric add-direct-method (specializer method))
299
300 (defgeneric add-direct-subclass (class subclass))
301
302 (defgeneric add-method (generic-function method))
303
304 (defgeneric (setf class-slot-cells) (new-value class))
305
306 (defgeneric class-slot-value (class slot-name))
307
308 (defgeneric compatible-meta-class-change-p (class proto-new-class))
309
310 (defgeneric compute-applicable-methods (generic-function arguments))
311
312 (defgeneric compute-applicable-methods-using-classes
313   (generic-function classes))
314
315 (defgeneric compute-effective-slot-definition-initargs (class direct-slotds))
316
317 (defgeneric describe-object (object stream))
318
319 (defgeneric direct-slot-definition-class (class &rest initargs))
320
321 (defgeneric effective-slot-definition-class (class &rest initargs))
322
323 (defgeneric make-boundp-method-function (class slot-name))
324
325 (defgeneric make-reader-method-function (class slot-name))
326
327 (defgeneric make-writer-method-function (class slot-name))
328
329 (defgeneric map-dependents (metaobject function))
330
331 (defgeneric parse-specializer-using-class (generic-function specializer-name))
332
333 (defgeneric remove-boundp-method (class generic-function))
334
335 (defgeneric remove-dependent (metaobject dependent))
336
337 (defgeneric remove-direct-method (specializer method))
338
339 (defgeneric remove-direct-subclass (class subclass))
340
341 (defgeneric remove-method (generic-function method))
342
343 (defgeneric remove-reader-method (class generic-function))
344
345 (defgeneric remove-writer-method (class generic-function))
346
347 (defgeneric same-specializer-p (specl1 specl2))
348
349 (defgeneric slot-accessor-function (slotd type))
350
351 (defgeneric slot-accessor-std-p (slotd type))
352
353 ;;; This controls DESCRIBE-OBJECT (SLOT-OBJECT STREAM) behavior.
354 (defgeneric slots-to-inspect (class object))
355
356 (defgeneric unparse-specializer-using-class (generic-function specializer))
357
358 (defgeneric validate-superclass (class superclass))
359
360 (defgeneric (setf documentation) (new-value slotd doc-type)
361   (:argument-precedence-order doc-type slotd new-value))
362
363 (defgeneric documentation (slotd doc-type)
364   (:argument-precedence-order doc-type slotd))
365 \f
366 ;;;; 3 arguments
367
368 (defgeneric (setf class-slot-value) (nv class slot-name))
369
370 ;;; CMUCL comment (from Gerd Moellmann/Pierre Mai, 2002-10-19):
371 ;;;
372 ;;; According to AMOP, COMPUTE-EFFECTIVE-METHOD should return two
373 ;;; values.  Alas, the second value is only vaguely described in AMOP,
374 ;;; and, when asked on 2002-10-18, Gregor Kiczales said he couldn't
375 ;;; remember what the second value was supposed to be.  So, PCL's
376 ;;; COMPUTE-EFFECTIVE-METHOD returns one value as do Allegro and
377 ;;; Lispworks.
378 (defgeneric compute-effective-method (generic-function
379                                       combin
380                                       applicable-methods))
381
382 (defgeneric compute-effective-slot-definition (class name dslotds))
383
384 (defgeneric compute-slot-accessor-info (slotd type gf))
385
386 (defgeneric find-method-combination (generic-function type options))
387
388 (defgeneric invalid-qualifiers (generic-function combin method))
389
390 (defgeneric (setf slot-accessor-function) (function slotd type))
391
392 (defgeneric (setf slot-accessor-std-p) (value slotd type))
393
394 (defgeneric slot-boundp-using-class (class object slotd))
395
396 (defgeneric slot-makunbound-using-class (class object slotd))
397
398 (defgeneric slot-unbound (class instance slot-name))
399
400 (defgeneric slot-value-using-class (class object slotd))
401 \f
402 ;;;; 4 arguments
403
404 (defgeneric make-method-lambda
405     (proto-generic-function proto-method lambda-expression environment))
406
407 (defgeneric make-method-specializers-form
408     (proto-generic-function proto-method specializer-names environment))
409
410 (defgeneric (setf slot-value-using-class) (new-value class object slotd))
411 \f
412 ;;;; 5 arguments
413
414 ;;; FIXME: This is currently unused -- where should we call it? Or should we just
415 ;;; delete it.
416 (defgeneric add-boundp-method (class generic-function slot-name slot-documentation source-location))
417
418 (defgeneric add-reader-method (class generic-function slot-name slot-documentation source-location))
419
420 (defgeneric add-writer-method (class generic-function slot-name slot-documentation source-location))
421
422 (defgeneric make-method-initargs-form
423     (proto-generic-function proto-method lambda-expression lambda-list
424      environment))
425 \f
426 ;;;; optional arguments
427
428 (defgeneric get-method (generic-function
429                         qualifiers
430                         specializers
431                         &optional errorp))
432
433 (defgeneric find-method (generic-function
434                          qualifiers
435                          specializers
436                          &optional errorp))
437
438 (defgeneric slot-missing (class
439                           instance
440                           slot-name
441                           operation
442                           &optional new-value))
443 \f
444 ;;;; &KEY arguments
445
446 ;;; FIXME: make the declared &KEY arguments here agree with those that
447 ;;; AMOP specifies.
448 (defgeneric allocate-instance (class &rest initargs))
449
450 (defgeneric ensure-class-using-class (class
451                                       name
452                                       &rest args
453                                       &key &allow-other-keys))
454
455 (defgeneric ensure-generic-function-using-class (generic-function
456                                                  fun-name
457                                                  &key &allow-other-keys))
458
459 (defgeneric initialize-instance (instance &rest initargs &key &allow-other-keys))
460
461 (defgeneric make-instance (class &rest initargs &key &allow-other-keys))
462
463 (defgeneric change-class (instance new-class-name &rest initargs &key &allow-other-keys))
464
465 (defgeneric no-applicable-method (generic-function &rest args))
466
467 (defgeneric no-next-method (generic-function method &rest args))
468
469 (defgeneric no-primary-method (generic-function &rest args))
470
471 (defgeneric reader-method-class (class direct-slot &rest initargs))
472
473 (defgeneric reinitialize-instance (instance &rest initargs &key &allow-other-keys))
474
475 (defgeneric shared-initialize (instance slot-names &rest initargs
476                                &key &allow-other-keys))
477
478 (defgeneric update-dependent (metaobject dependent &rest initargs))
479
480 (defgeneric update-instance-for-different-class (previous
481                                                  current
482                                                  &rest initargs))
483
484 (defgeneric update-instance-for-redefined-class (instance
485                                                  added-slots
486                                                  discarded-slots
487                                                  property-list
488                                                  &rest initargs))
489
490 (defgeneric writer-method-class (class direct-slot &rest initargs))