0.7.7.10:
[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 eql-specializer-p (object))
18
19 (defgeneric exact-class-specializer-p (object))
20
21 (defgeneric forward-referenced-class-p (object))
22
23 (defgeneric funcallable-standard-class-p (object))
24
25 (defgeneric generic-function-p (object))
26
27 (defgeneric legal-lambda-list-p (object x))
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-initialize-info (slot-class))
74
75 (defgeneric class-name (class))
76
77 (defgeneric class-precedence-list (pcl-class))
78
79 (defgeneric class-predicate-name (class))
80
81 (defgeneric class-wrapper (pcl-class))
82
83 (defgeneric definition-source (definition-source-mixin))
84
85 (defgeneric eql-specializer-object (eql-specializer))
86
87 (defgeneric generic-function-method-class (standard-generic-function))
88
89 (defgeneric generic-function-method-combination (standard-generic-function))
90
91 (defgeneric generic-function-methods (standard-generic-function))
92
93 (defgeneric generic-function-name (standard-generic-function))
94
95 (defgeneric gf-arg-info (standard-generic-function))
96
97 (defgeneric gf-dfun-state (standard-generic-function))
98
99 (defgeneric generic-function-initial-methods (standard-generic-function))
100
101 (defgeneric long-method-combination-function (long-method-combination))
102
103 (defgeneric method-combination-documentation (standard-method-combination))
104
105 (defgeneric method-combination-options (standard-method-combination))
106
107 (defgeneric method-combination-type (standard-method-combination))
108
109 (defgeneric method-fast-function (standard-method))
110
111 (defgeneric method-generic-function (standard-method))
112
113 (defgeneric object-plist (plist-mixin))
114
115 (defgeneric short-combination-identity-with-one-argument
116   (short-method-combination))
117
118 (defgeneric short-combination-operator (short-method-combination))
119
120 (defgeneric slot-definition-boundp-function (effective-slot-definition))
121
122 (defgeneric slot-definition-class (slot-definition))
123
124 (defgeneric slot-definition-defstruct-accessor-symbol
125   (structure-slot-definition))
126
127 (defgeneric slot-definition-initargs (slot-definition))
128
129 (defgeneric slot-definition-initform (slot-definition))
130
131 (defgeneric slot-definition-initfunction (slot-definition))
132
133 (defgeneric slot-definition-internal-reader-function
134   (structure-slot-definition))
135
136 (defgeneric slot-definition-internal-writer-function
137   (structure-slot-definition))
138
139 (defgeneric slot-definition-location (standard-effective-slot-definition))
140
141 (defgeneric slot-definition-name (slot-definition))
142
143 (defgeneric slot-definition-reader-function (effective-slot-definition))
144
145 (defgeneric slot-definition-readers (slot-definition))
146
147 (defgeneric slot-definition-type (slot-definition))
148
149 (defgeneric slot-definition-writer-function (effective-slot-definition))
150
151 (defgeneric slot-definition-writers (slot-definition))
152
153 (defgeneric specializer-object (class-eq-specializer))
154
155 (defgeneric specializer-type (specializer))
156 \f
157 ;;;; writers
158
159 (defgeneric (setf class-defstruct-constructor) (new-value structure-class))
160
161 (defgeneric (setf class-defstruct-form) (new-value structure-class))
162
163 (defgeneric (setf class-direct-slots) (new-value slot-class))
164
165 (defgeneric (setf class-incompatible-superclass-list) (new-value pcl-class))
166
167 (defgeneric (setf class-initialize-info) (new-value slot-class))
168
169 (defgeneric (setf class-name) (new-value class))
170
171 (defgeneric (setf class-slots) (new-value slot-class))
172
173 (defgeneric (setf generic-function-method-class) (new-value
174                                                   standard-generic-function))
175
176 (defgeneric (setf generic-function-method-combination)
177   (new-value standard-generic-function))
178
179 (defgeneric (setf generic-function-methods) (new-value
180                                              standard-generic-function))
181
182 (defgeneric (setf generic-function-name) (new-value standard-generic-function))
183
184 (defgeneric (setf gf-dfun-state) (new-value standard-generic-function))
185
186 (defgeneric (setf generic-function-initial-methods)
187   (new-value standard-generic-function))
188
189 (defgeneric (setf method-generic-function) (new-value standard-method))
190
191 (defgeneric (setf object-plist) (new-value plist-mixin))
192
193 (defgeneric (setf slot-definition-allocation) (new-value
194                                                standard-slot-definition))
195
196 (defgeneric (setf slot-definition-boundp-function)
197   (new-value effective-slot-definition))
198
199 (defgeneric (setf slot-definition-class) (new-value slot-definition))
200
201 (defgeneric (setf slot-definition-defstruct-accessor-symbol)
202   (new-value structure-slot-definition))
203
204 (defgeneric (setf slot-definition-initargs) (new-value slot-definition))
205
206 (defgeneric (setf slot-definition-initform) (new-value slot-definition))
207
208 (defgeneric (setf slot-definition-initfunction) (new-value slot-definition))
209
210 (defgeneric (setf slot-definition-internal-reader-function)
211   (new-value structure-slot-definition))
212
213 (defgeneric (setf slot-definition-internal-writer-function)
214   (new-value structure-slot-definition))
215
216 (defgeneric (setf slot-definition-location)
217   (new-value standard-effective-slot-definition))
218
219 (defgeneric (setf slot-definition-name) (new-value slot-definition))
220
221 (defgeneric (setf slot-definition-reader-function) (new-value
222                                                     effective-slot-definition))
223
224 (defgeneric (setf slot-definition-readers) (new-value slot-definition))
225
226 (defgeneric (setf slot-definition-type) (new-value slot-definition))
227
228 (defgeneric (setf slot-definition-writer-function)
229   (new-value effective-slot-definition))
230
231 (defgeneric (setf slot-definition-writers) (new-value slot-definition))
232 \f
233 ;;;; 1 argument
234
235 (defgeneric accessor-method-class (method))
236
237 (defgeneric accessor-method-slot-name (m))
238
239 (defgeneric class-default-initargs (class))
240
241 (defgeneric class-direct-default-initargs (class))
242
243 (defgeneric class-direct-slots (class))
244
245 (defgeneric class-finalized-p (class))
246
247 (defgeneric class-prototype (class))
248
249 (defgeneric class-slot-cells (class))
250
251 (defgeneric class-slots (class))
252
253 (defgeneric compute-class-precedence-list (root))
254
255 (defgeneric compute-default-initargs (class))
256
257 (defgeneric compute-discriminating-function (gf))
258
259 (defgeneric compute-discriminating-function-arglist-info (generic-function))
260
261 (defgeneric compute-slots (class))
262
263 (defgeneric finalize-inheritance (class))
264
265 (defgeneric function-keywords (method))
266
267 (defgeneric generic-function-lambda-list (gf))
268
269 (defgeneric generic-function-pretty-arglist (generic-function))
270
271 (defgeneric gf-fast-method-function-p (gf))
272
273 (defgeneric initialize-internal-slot-functions (slotd))
274
275 (defgeneric make-instances-obsolete (class))
276
277 (defgeneric method-function (method))
278
279 (defgeneric method-lambda-list (m))
280
281 (defgeneric method-pretty-arglist (method))
282
283 (defgeneric method-qualifiers (m))
284
285 (defgeneric method-specializers (m))
286
287 (defgeneric raw-instance-allocator (class))
288
289 (defgeneric slot-definition-allocation (slotd))
290
291 (defgeneric slots-fetcher (class))
292
293 (defgeneric specializer-class (specializer))
294
295 (defgeneric specializer-direct-generic-functions (specializer))
296
297 (defgeneric specializer-direct-methods (specializer))
298
299 (defgeneric specializer-method-table (specializer))
300
301 (defgeneric update-constructors (class))
302
303 (defgeneric wrapper-fetcher (class))
304 \f
305 ;;;; 2 arguments
306
307 (defgeneric add-dependent (metaobject dependent))
308
309 (defgeneric add-direct-method (specializer method))
310
311 (defgeneric add-direct-subclass (class subclass))
312
313 (defgeneric add-method (generic-function method))
314
315 (defgeneric class-slot-value (class slot-name))
316
317 (defgeneric compatible-meta-class-change-p (class proto-new-class))
318
319 (defgeneric compute-applicable-methods (generic-function arguments))
320
321 (defgeneric compute-applicable-methods-using-classes
322   (generic-function classes))
323
324 (defgeneric compute-effective-slot-definition (class dslotds))
325
326 (defgeneric compute-effective-slot-definition-initargs (class direct-slotds))
327
328 (defgeneric default-initargs (class supplied-initargs))
329
330 (defgeneric describe-object (object stream))
331
332 (defgeneric direct-slot-definition-class (class initargs))
333
334 (defgeneric effective-slot-definition-class (class initargs))
335
336 (defgeneric legal-documentation-p (object x))
337
338 (defgeneric legal-method-function-p (object x))
339
340 (defgeneric legal-qualifier-p (object x))
341
342 (defgeneric legal-qualifiers-p (object x))
343
344 (defgeneric legal-slot-name-p (object x))
345
346 (defgeneric legal-specializer-p (object x))
347
348 (defgeneric legal-specializers-p (object x))
349
350 (defgeneric make-boundp-method-function (class slot-name))
351
352 (defgeneric make-reader-method-function (class slot-name))
353
354 (defgeneric make-writer-method-function (class slot-name))
355
356 (defgeneric map-dependents (metaobject function))
357
358 (defgeneric remove-boundp-method (class generic-function))
359
360 (defgeneric remove-dependent (metaobject dependent))
361
362 (defgeneric remove-direct-method (specializer method))
363
364 (defgeneric remove-direct-subclass (class subclass))
365
366 (defgeneric remove-method (generic-function method))
367
368 (defgeneric remove-reader-method (class generic-function))
369
370 (defgeneric remove-writer-method (class generic-function))
371
372 (defgeneric same-specializer-p (specl1 specl2))
373
374 (defgeneric slot-accessor-function (slotd type))
375
376 (defgeneric slot-accessor-std-p (slotd type))
377
378 ;;; This controls DESCRIBE-OBJECT (SLOT-OBJECT STREAM) behavior.
379 (defgeneric slots-to-inspect (class object))
380
381 (defgeneric update-gf-dfun (class gf))
382
383 (defgeneric validate-superclass (fsc class))
384
385 (defgeneric (setf documentation) (new-value slotd doc-type)
386   (:argument-precedence-order doc-type slotd new-value))
387
388 (defgeneric documentation (slotd doc-type)
389   (:argument-precedence-order doc-type slotd))
390 \f
391 ;;;; 3 arguments
392
393 (defgeneric add-boundp-method (class generic-function slot-name))
394
395 (defgeneric add-reader-method (class generic-function slot-name))
396
397 (defgeneric add-writer-method (class generic-function slot-name))
398
399 (defgeneric (setf class-slot-value) (nv class slot-name))
400
401 (defgeneric compute-effective-method (generic-function
402                                       combin
403                                       applicable-methods))
404
405 (defgeneric compute-slot-accessor-info (slotd type gf))
406
407 (defgeneric find-method-combination (generic-function type options))
408
409 (defgeneric (setf slot-accessor-function) (function slotd type))
410
411 (defgeneric (setf slot-accessor-std-p) (value slotd type))
412
413 (defgeneric slot-boundp-using-class (class object slotd))
414
415 (defgeneric slot-makunbound-using-class (class object slotd))
416
417 (defgeneric slot-unbound (class instance slot-name))
418
419 (defgeneric slot-value-using-class (class object slotd))
420 \f
421 ;;;; 4 arguments
422
423 (defgeneric make-method-lambda (proto-generic-function
424                                 proto-method
425                                 lambda-expression
426                                 environment))
427
428 (defgeneric (setf slot-value-using-class) (new-value class object slotd))
429 \f
430 ;;;; 5 arguments
431
432 (defgeneric make-method-initargs-form (proto-generic-function
433                                        proto-method
434                                        lambda-expression
435                                        lambda-list
436                                        environment))
437 \f
438 ;;;; optional arguments
439
440 (defgeneric get-method (generic-function
441                         qualifiers
442                         specializers
443                         &optional errorp))
444
445 (defgeneric find-method (generic-function
446                          qualifiers
447                          specializers
448                          &optional errorp))
449
450 (defgeneric remove-named-method (generic-function-name
451                                  argument-specifiers
452                                  &optional extra))
453
454 (defgeneric slot-missing (class
455                           instance
456                           slot-name
457                           operation
458                           &optional new-value))
459 \f
460 ;;;; &KEY arguments
461
462 (defgeneric allocate-instance (class &rest initargs))
463
464 (defgeneric ensure-class-using-class (name
465                                       class
466                                       &rest args
467                                       &key &allow-other-keys))
468
469 (defgeneric ensure-generic-function-using-class (generic-function
470                                                  fun-name
471                                                  &key &allow-other-keys))
472
473 (defgeneric initialize-instance (gf &key &allow-other-keys))
474
475 (defgeneric make-instance (class &rest initargs &key &allow-other-keys))
476
477 (defgeneric change-class (instance new-class-name &rest initargs &key &allow-other-keys))
478
479 (defgeneric no-applicable-method (generic-function &rest args))
480
481 (defgeneric reader-method-class (class direct-slot &rest initargs))
482
483 (defgeneric reinitialize-instance (gf &rest args &key &allow-other-keys))
484
485 (defgeneric shared-initialize (generic-function
486                                slot-names
487                                &key &allow-other-keys))
488
489 (defgeneric update-dependent (metaobject dependent &rest initargs))
490
491 (defgeneric update-instance-for-different-class (previous
492                                                  current
493                                                  &rest initargs))
494
495 (defgeneric update-instance-for-redefined-class (instance
496                                                  added-slots
497                                                  discarded-slots
498                                                  property-list
499                                                  &rest initargs))
500
501 (defgeneric writer-method-class (class direct-slot &rest initargs))