0.9.4.55:
[sbcl.git] / src / pcl / defs.lisp
1 ;;;; This software is part of the SBCL system. See the README file for
2 ;;;; more information.
3
4 ;;;; This software is derived from software originally released by Xerox
5 ;;;; Corporation. Copyright and release statements follow. Later modifications
6 ;;;; to the software are in the public domain and are provided with
7 ;;;; absolutely no warranty. See the COPYING and CREDITS files for more
8 ;;;; information.
9
10 ;;;; copyright information from original PCL sources:
11 ;;;;
12 ;;;; Copyright (c) 1985, 1986, 1987, 1988, 1989, 1990 Xerox Corporation.
13 ;;;; All rights reserved.
14 ;;;;
15 ;;;; Use and copying of this software and preparation of derivative works based
16 ;;;; upon this software are permitted. Any distribution of this software or
17 ;;;; derivative works must comply with all applicable United States export
18 ;;;; control laws.
19 ;;;;
20 ;;;; This software is made available AS IS, and Xerox Corporation makes no
21 ;;;; warranty about the software, its performance or its conformity to any
22 ;;;; specification.
23
24 (in-package "SB-PCL")
25 \f
26 ;;; (These are left over from the days when PCL was an add-on package
27 ;;; for a pre-CLOS Common Lisp. They shouldn't happen in a normal
28 ;;; build, of course, but they might happen if someone is experimenting
29 ;;; and debugging, and it's probably worth complaining if they do,
30 ;;; so we've left 'em in.)
31 (when (eq *boot-state* 'complete)
32   (error "Trying to load (or compile) PCL in an environment in which it~%~
33           has already been loaded. This doesn't work, you will have to~%~
34           get a fresh lisp (reboot) and then load PCL."))
35 (when *boot-state*
36   (cerror "Try loading (or compiling) PCL anyways."
37           "Trying to load (or compile) PCL in an environment in which it~%~
38            has already been partially loaded. This may not work, you may~%~
39            need to get a fresh lisp (reboot) and then load PCL."))
40 \f
41 ;;; comments from CMU CL version of PCL:
42 ;;;     This is like fdefinition on the Lispm. If Common Lisp had
43 ;;;   something like function specs I wouldn't need this. On the other
44 ;;;   hand, I don't like the way this really works so maybe function
45 ;;;   specs aren't really right either?
46 ;;;     I also don't understand the real implications of a Lisp-1 on this
47 ;;;   sort of thing. Certainly some of the lossage in all of this is
48 ;;;   because these SPECs name global definitions.
49 ;;;     Note that this implementation is set up so that an implementation
50 ;;;   which has a 'real' function spec mechanism can use that instead
51 ;;;   and in that way get rid of setf generic function names.
52 (defmacro parse-gspec (spec
53                        (non-setf-var . non-setf-case))
54   `(let ((,non-setf-var ,spec)) ,@non-setf-case))
55
56 ;;; If symbol names a function which is traced, return the untraced
57 ;;; definition. This lets us get at the generic function object even
58 ;;; when it is traced.
59 (defun unencapsulated-fdefinition (symbol)
60   (fdefinition symbol))
61
62 ;;; If symbol names a function which is traced, redefine the `real'
63 ;;; definition without affecting the trace.
64 (defun fdefine-carefully (name new-definition)
65   (progn
66     (sb-c::note-name-defined name :function)
67     new-definition)
68   (setf (fdefinition name) new-definition))
69
70 (defun gboundp (spec)
71   (parse-gspec spec
72     (name (fboundp name))))
73
74 (defun gmakunbound (spec)
75   (parse-gspec spec
76     (name (fmakunbound name))))
77
78 (defun gdefinition (spec)
79   (parse-gspec spec
80     (name (unencapsulated-fdefinition name))))
81
82 (defun (setf gdefinition) (new-value spec)
83   (parse-gspec spec
84     (name (fdefine-carefully name new-value))))
85 \f
86 ;;;; type specifier hackery
87
88 ;;; internal to this file
89 (defun coerce-to-class (class &optional make-forward-referenced-class-p)
90   (if (symbolp class)
91       (or (find-class class (not make-forward-referenced-class-p))
92           (ensure-class class))
93       class))
94
95 ;;; interface
96 (defun specializer-from-type (type &aux args)
97   (when (consp type)
98     (setq args (cdr type) type (car type)))
99   (cond ((symbolp type)
100          (or (and (null args) (find-class type))
101              (ecase type
102                (class    (coerce-to-class (car args)))
103                (prototype (make-instance 'class-prototype-specializer
104                                          :object (coerce-to-class (car args))))
105                (class-eq (class-eq-specializer (coerce-to-class (car args))))
106                (eql      (intern-eql-specializer (car args))))))
107         ;; FIXME: do we still need this?
108         ((and (null args) (typep type 'classoid))
109          (or (classoid-pcl-class type)
110              (ensure-non-standard-class (classoid-name type))))
111         ((specializerp type) type)))
112
113 ;;; interface
114 (defun type-from-specializer (specl)
115   (cond ((eq specl t)
116          t)
117         ((consp specl)
118          (unless (member (car specl) '(class prototype class-eq eql))
119            (error "~S is not a legal specializer type." specl))
120          specl)
121         ((progn
122            (when (symbolp specl)
123              ;;maybe (or (find-class specl nil) (ensure-class specl)) instead?
124              (setq specl (find-class specl)))
125            (or (not (eq *boot-state* 'complete))
126                (specializerp specl)))
127          (specializer-type specl))
128         (t
129          (error "~S is neither a type nor a specializer." specl))))
130
131 (defun type-class (type)
132   (declare (special *the-class-t*))
133   (setq type (type-from-specializer type))
134   (if (atom type)
135       (if (eq type t)
136           *the-class-t*
137           (error "bad argument to TYPE-CLASS"))
138       (case (car type)
139         (eql (class-of (cadr type)))
140         (prototype (class-of (cadr type))) ;?
141         (class-eq (cadr type))
142         (class (cadr type)))))
143
144 (defun class-eq-type (class)
145   (specializer-type (class-eq-specializer class)))
146
147 ;;; internal to this file..
148 ;;;
149 ;;; These functions are a pale imitation of their namesake. They accept
150 ;;; class objects or types where they should.
151 (defun *normalize-type (type)
152   (cond ((consp type)
153          (if (member (car type) '(not and or))
154              `(,(car type) ,@(mapcar #'*normalize-type (cdr type)))
155              (if (null (cdr type))
156                  (*normalize-type (car type))
157                  type)))
158         ((symbolp type)
159          (let ((class (find-class type nil)))
160            (if class
161                (let ((type (specializer-type class)))
162                  (if (listp type) type `(,type)))
163                `(,type))))
164         ((or (not (eq *boot-state* 'complete))
165              (specializerp type))
166          (specializer-type type))
167         (t
168          (error "~S is not a type." type))))
169
170 ;;; internal to this file...
171 (defun convert-to-system-type (type)
172   (case (car type)
173     ((not and or) `(,(car type) ,@(mapcar #'convert-to-system-type
174                                           (cdr type))))
175     ((class class-eq) ; class-eq is impossible to do right
176      (layout-classoid (class-wrapper (cadr type))))
177     (eql type)
178     (t (if (null (cdr type))
179            (car type)
180            type))))
181
182 ;;; Writing the missing NOT and AND clauses will improve the quality
183 ;;; of code generated by GENERATE-DISCRIMINATION-NET, but calling
184 ;;; SUBTYPEP in place of just returning (VALUES NIL NIL) can be very
185 ;;; slow. *SUBTYPEP is used by PCL itself, and must be fast.
186 ;;;
187 ;;; FIXME: SB-KERNEL has fast-and-not-quite-precise type code for use
188 ;;; in the compiler. Could we share some of it here?
189 (defun *subtypep (type1 type2)
190   (if (equal type1 type2)
191       (values t t)
192       (if (eq *boot-state* 'early)
193           (values (eq type1 type2) t)
194           (let ((*in-precompute-effective-methods-p* t))
195             (declare (special *in-precompute-effective-methods-p*))
196             ;; FIXME: *IN-PRECOMPUTE-EFFECTIVE-METHODS-P* is not a
197             ;; good name. It changes the way
198             ;; CLASS-APPLICABLE-USING-CLASS-P works.
199             (setq type1 (*normalize-type type1))
200             (setq type2 (*normalize-type type2))
201             (case (car type2)
202               (not
203                (values nil nil)) ; XXX We should improve this.
204               (and
205                (values nil nil)) ; XXX We should improve this.
206               ((eql wrapper-eq class-eq class)
207                (multiple-value-bind (app-p maybe-app-p)
208                    (specializer-applicable-using-type-p type2 type1)
209                  (values app-p (or app-p (not maybe-app-p)))))
210               (t
211                (subtypep (convert-to-system-type type1)
212                          (convert-to-system-type type2))))))))
213 \f
214 (defvar *built-in-class-symbols* ())
215 (defvar *built-in-wrapper-symbols* ())
216
217 (defun get-built-in-class-symbol (class-name)
218   (or (cadr (assq class-name *built-in-class-symbols*))
219       (let ((symbol (make-class-symbol class-name)))
220         (push (list class-name symbol) *built-in-class-symbols*)
221         symbol)))
222
223 (defun get-built-in-wrapper-symbol (class-name)
224   (or (cadr (assq class-name *built-in-wrapper-symbols*))
225       (let ((symbol (make-wrapper-symbol class-name)))
226         (push (list class-name symbol) *built-in-wrapper-symbols*)
227         symbol)))
228 \f
229 (pushnew '%class *var-declarations*)
230 (pushnew '%variable-rebinding *var-declarations*)
231
232 (defun variable-class (var env)
233   (caddr (var-declaration 'class var env)))
234
235 (defvar *name->class->slotd-table* (make-hash-table))
236
237 (defvar *standard-method-combination*)
238 \f
239 (defun make-class-predicate-name (name)
240   (list 'class-predicate name))
241
242 (defun plist-value (object name)
243   (getf (object-plist object) name))
244
245 (defun (setf plist-value) (new-value object name)
246   (if new-value
247       (setf (getf (object-plist object) name) new-value)
248       (progn
249         (remf (object-plist object) name)
250         nil)))
251 \f
252 ;;;; built-in classes
253
254 ;;; Grovel over SB-KERNEL::*BUILT-IN-CLASSES* in order to set
255 ;;; SB-PCL:*BUILT-IN-CLASSES*.
256 (/show "about to set up SB-PCL::*BUILT-IN-CLASSES*")
257 (defvar *built-in-classes*
258   (labels ((direct-supers (class)
259              (/noshow "entering DIRECT-SUPERS" (classoid-name class))
260              (if (typep class 'built-in-classoid)
261                  (built-in-classoid-direct-superclasses class)
262                  (let ((inherits (layout-inherits
263                                   (classoid-layout class))))
264                    (/noshow inherits)
265                    (list (svref inherits (1- (length inherits)))))))
266            (direct-subs (class)
267              (/noshow "entering DIRECT-SUBS" (classoid-name class))
268              (collect ((res))
269                (let ((subs (classoid-subclasses class)))
270                  (/noshow subs)
271                  (when subs
272                    (dohash (sub v subs)
273                      (declare (ignore v))
274                      (/noshow sub)
275                      (when (member class (direct-supers sub))
276                        (res sub)))))
277                (res))))
278     (mapcar (lambda (kernel-bic-entry)
279               (/noshow "setting up" kernel-bic-entry)
280               (let* ((name (car kernel-bic-entry))
281                      (class (find-classoid name))
282                      (prototype-form
283                       (getf (cdr kernel-bic-entry) :prototype-form)))
284                 (/noshow name class)
285                 `(,name
286                   ,(mapcar #'classoid-name (direct-supers class))
287                   ,(mapcar #'classoid-name (direct-subs class))
288                   ,(map 'list
289                         (lambda (x)
290                           (classoid-name
291                            (layout-classoid x)))
292                         (reverse
293                          (layout-inherits
294                           (classoid-layout class))))
295                   ,(if prototype-form
296                        (eval prototype-form)
297                        ;; This is the default prototype value which
298                        ;; was used, without explanation, by the CMU CL
299                        ;; code we're derived from. Evidently it's safe
300                        ;; in all relevant cases.
301                        42))))
302             (remove-if (lambda (kernel-bic-entry)
303                          (member (first kernel-bic-entry)
304                                  ;; I'm not sure why these are removed from
305                                  ;; the list, but that's what the original
306                                  ;; CMU CL code did. -- WHN 20000715
307                                  '(t function stream
308                                      file-stream string-stream)))
309                        sb-kernel::*built-in-classes*))))
310 (/noshow "done setting up SB-PCL::*BUILT-IN-CLASSES*")
311 \f
312 ;;;; the classes that define the kernel of the metabraid
313
314 (defclass t () ()
315   (:metaclass built-in-class))
316
317 (defclass function (t) ()
318   (:metaclass built-in-class))
319
320 (defclass stream (t) ()
321   (:metaclass built-in-class))
322
323 (defclass file-stream (stream) ()
324   (:metaclass built-in-class))
325
326 (defclass string-stream (stream) ()
327   (:metaclass built-in-class))
328
329 (defclass slot-object (t) ()
330   (:metaclass slot-class))
331
332 (defclass condition (slot-object) ()
333   (:metaclass condition-class))
334
335 (defclass structure-object (slot-object) ()
336   (:metaclass structure-class))
337
338 (defstruct (dead-beef-structure-object
339             (:constructor |STRUCTURE-OBJECT class constructor|)
340             (:copier nil)))
341
342 (defclass standard-object (slot-object) ())
343
344 (defclass funcallable-standard-object (standard-object function)
345   ()
346   (:metaclass funcallable-standard-class))
347
348 (defclass specializer (standard-object)
349   ((type :initform nil :reader specializer-type)))
350
351 (defclass definition-source-mixin (standard-object)
352   ((source :initform *load-pathname* :reader definition-source
353            :initarg :definition-source)))
354
355 (defclass plist-mixin (standard-object)
356   ((plist :initform () :accessor object-plist)))
357
358 (defclass dependent-update-mixin (plist-mixin) ())
359
360 ;;; The class CLASS is a specified basic class. It is the common
361 ;;; superclass of any kind of class. That is, any class that can be a
362 ;;; metaclass must have the class CLASS in its class precedence list.
363 (defclass class (dependent-update-mixin
364                  definition-source-mixin
365                  specializer)
366   ((name
367     :initform nil
368     :initarg  :name
369     :accessor class-name)
370    (class-eq-specializer
371     :initform nil
372     :reader class-eq-specializer)
373    (direct-superclasses
374     :initform ()
375     :reader class-direct-superclasses)
376    ;; Note: The (CLASS-)DIRECT-SUBCLASSES for STRUCTURE-CLASSes and
377    ;; CONDITION-CLASSes are lazily computed whenever the subclass info
378    ;; becomes available, i.e. when the PCL class is created.
379    (direct-subclasses
380     :initform ()
381     :reader class-direct-subclasses)
382    (direct-methods
383     :initform (cons nil nil))
384    (predicate-name
385     :initform nil
386     :reader class-predicate-name)
387    (documentation
388     :initform nil
389     :initarg :documentation)
390    (finalized-p
391     :initform nil
392     :reader class-finalized-p)))
393
394 (def!method make-load-form ((class class) &optional env)
395   ;; FIXME: should we not instead pass ENV to FIND-CLASS?  Probably
396   ;; doesn't matter while all our environments are the same...
397   (declare (ignore env))
398   (let ((name (class-name class)))
399     (unless (and name (eq (find-class name nil) class))
400       (error "~@<Can't use anonymous or undefined class as constant: ~S~:@>"
401              class))
402     `(find-class ',name)))
403
404 ;;; The class PCL-CLASS is an implementation-specific common
405 ;;; superclass of all specified subclasses of the class CLASS.
406 (defclass pcl-class (class)
407   ((class-precedence-list
408     :reader class-precedence-list)
409    ;; KLUDGE: see note in CPL-OR-NIL
410    (cpl-available-p
411     :reader cpl-available-p
412     :initform nil)
413    (can-precede-list
414     :initform ()
415     :reader class-can-precede-list)
416    (incompatible-superclass-list
417     :initform ()
418     :accessor class-incompatible-superclass-list)
419    (wrapper
420     :initform nil
421     :reader class-wrapper)
422    (prototype
423     :initform nil
424     :reader class-prototype)))
425
426 (defclass slot-class (pcl-class)
427   ((direct-slots
428     :initform ()
429     :accessor class-direct-slots)
430    (slots
431     :initform ()
432     :accessor class-slots)))
433
434 ;;; The class STD-CLASS is an implementation-specific common
435 ;;; superclass of the classes STANDARD-CLASS and
436 ;;; FUNCALLABLE-STANDARD-CLASS.
437 (defclass std-class (slot-class)
438   ())
439
440 (defclass standard-class (std-class)
441   ())
442
443 (defclass funcallable-standard-class (std-class)
444   ())
445
446 (defclass forward-referenced-class (pcl-class) ())
447
448 (defclass built-in-class (pcl-class) ())
449
450 (defclass condition-class (slot-class) ())
451
452 (defclass structure-class (slot-class)
453   ((defstruct-form
454      :initform ()
455      :accessor class-defstruct-form)
456    (defstruct-constructor
457      :initform nil
458      :accessor class-defstruct-constructor)
459    (from-defclass-p
460     :initform nil
461     :initarg :from-defclass-p)))
462
463 (defclass specializer-with-object (specializer) ())
464
465 (defclass exact-class-specializer (specializer) ())
466
467 (defclass class-eq-specializer (exact-class-specializer
468                                 specializer-with-object)
469   ((object :initarg :class
470            :reader specializer-class
471            :reader specializer-object)))
472
473 (defclass class-prototype-specializer (specializer-with-object)
474   ((object :initarg :class
475            :reader specializer-class
476            :reader specializer-object)))
477
478 (defclass eql-specializer (exact-class-specializer specializer-with-object)
479   ((object :initarg :object :reader specializer-object
480            :reader eql-specializer-object)))
481
482 (defvar *eql-specializer-table* (make-hash-table :test 'eql))
483
484 (defun intern-eql-specializer (object)
485   (or (gethash object *eql-specializer-table*)
486       (setf (gethash object *eql-specializer-table*)
487             (make-instance 'eql-specializer :object object))))
488 \f
489 ;;;; slot definitions
490
491 (defclass slot-definition (standard-object)
492   ((name
493     :initform nil
494     :initarg :name
495     :accessor slot-definition-name)
496    (initform
497     :initform nil
498     :initarg :initform
499     :accessor slot-definition-initform)
500    (initfunction
501     :initform nil
502     :initarg :initfunction
503     :accessor slot-definition-initfunction)
504    (readers
505     :initform nil
506     :initarg :readers
507     :accessor slot-definition-readers)
508    (writers
509     :initform nil
510     :initarg :writers
511     :accessor slot-definition-writers)
512    (initargs
513     :initform nil
514     :initarg :initargs
515     :accessor slot-definition-initargs)
516    (type
517     :initform t
518     :initarg :type
519     :accessor slot-definition-type)
520    (documentation
521     :initform nil
522     :initarg :documentation)
523    (class
524     :initform nil
525     :initarg :class
526     :accessor slot-definition-class)))
527
528 (defclass standard-slot-definition (slot-definition)
529   ((allocation
530     :initform :instance
531     :initarg :allocation
532     :accessor slot-definition-allocation)
533    (allocation-class
534     :initform nil
535     :initarg :allocation-class
536     :accessor slot-definition-allocation-class)))
537
538 (defclass condition-slot-definition (slot-definition)
539   ((allocation
540     :initform :instance
541     :initarg :allocation
542     :accessor slot-definition-allocation)
543    (allocation-class
544     :initform nil
545     :initarg :allocation-class
546     :accessor slot-definition-allocation-class)))
547
548 (defclass structure-slot-definition (slot-definition)
549   ((defstruct-accessor-symbol
550      :initform nil
551      :initarg :defstruct-accessor-symbol
552      :accessor slot-definition-defstruct-accessor-symbol)
553    (internal-reader-function
554      :initform nil
555      :initarg :internal-reader-function
556      :accessor slot-definition-internal-reader-function)
557    (internal-writer-function
558      :initform nil
559      :initarg :internal-writer-function
560      :accessor slot-definition-internal-writer-function)))
561
562 (defclass direct-slot-definition (slot-definition)
563   ())
564
565 (defclass effective-slot-definition (slot-definition)
566   ((reader-function ; (lambda (object) ...)
567     :accessor slot-definition-reader-function)
568    (writer-function ; (lambda (new-value object) ...)
569     :accessor slot-definition-writer-function)
570    (boundp-function ; (lambda (object) ...)
571     :accessor slot-definition-boundp-function)
572    (accessor-flags
573     :initform 0)))
574
575 (defclass standard-direct-slot-definition (standard-slot-definition
576                                            direct-slot-definition)
577   ())
578
579 (defclass standard-effective-slot-definition (standard-slot-definition
580                                               effective-slot-definition)
581   ((location ; nil, a fixnum, a cons: (slot-name . value)
582     :initform nil
583     :accessor slot-definition-location)))
584
585 (defclass condition-direct-slot-definition (condition-slot-definition
586                                             direct-slot-definition)
587   ())
588
589 (defclass condition-effective-slot-definition (condition-slot-definition
590                                                effective-slot-definition)
591   ())
592
593 (defclass structure-direct-slot-definition (structure-slot-definition
594                                             direct-slot-definition)
595   ())
596
597 (defclass structure-effective-slot-definition (structure-slot-definition
598                                                effective-slot-definition)
599   ())
600
601 (defclass method (standard-object) ())
602
603 (defclass standard-method (definition-source-mixin plist-mixin method)
604   ((generic-function
605     :initform nil
606     :accessor method-generic-function)
607 ;;;     (qualifiers
608 ;;;     :initform ()
609 ;;;     :initarg  :qualifiers
610 ;;;     :reader method-qualifiers)
611    (specializers
612     :initform ()
613     :initarg  :specializers
614     :reader method-specializers)
615    (lambda-list
616     :initform ()
617     :initarg  :lambda-list
618     :reader method-lambda-list)
619    (function
620     :initform nil
621     :initarg :function)                 ;no writer
622    (fast-function
623     :initform nil
624     :initarg :fast-function             ;no writer
625     :reader method-fast-function)
626    (documentation
627     :initform nil
628     :initarg :documentation)))
629
630 (defclass standard-accessor-method (standard-method)
631   ((slot-name :initform nil
632               :initarg :slot-name
633               :reader accessor-method-slot-name)
634    (slot-definition :initform nil
635                     :initarg :slot-definition
636                     :reader accessor-method-slot-definition)))
637
638 (defclass standard-reader-method (standard-accessor-method) ())
639
640 (defclass standard-writer-method (standard-accessor-method) ())
641
642 (defclass standard-boundp-method (standard-accessor-method) ())
643
644 (defclass generic-function (dependent-update-mixin
645                             definition-source-mixin
646                             funcallable-standard-object)
647   ((documentation
648     :initform nil
649     :initarg :documentation)
650    ;; We need to make a distinction between the methods initially set
651    ;; up by :METHOD options to DEFGENERIC and the ones set up later by
652    ;; DEFMETHOD, because ANSI specifies that executing DEFGENERIC on
653    ;; an already-DEFGENERICed function clears the methods set by the
654    ;; previous DEFGENERIC, but not methods set by DEFMETHOD. (Making
655    ;; this distinction seems a little kludgy, but it has the positive
656    ;; effect of making it so that loading a file a.lisp containing
657    ;; DEFGENERIC, then loading a second file b.lisp containing
658    ;; DEFMETHOD, then modifying and reloading a.lisp and/or b.lisp
659    ;; tends to leave the generic function in a state consistent with
660    ;; the most-recently-loaded state of a.lisp and b.lisp.)
661    (initial-methods
662     :initform ()
663     :accessor generic-function-initial-methods))
664   (:metaclass funcallable-standard-class))
665
666 (defclass standard-generic-function (generic-function)
667   ((name
668     :initform nil
669     :initarg :name
670     :accessor generic-function-name)
671    (methods
672     :initform ()
673     :accessor generic-function-methods
674     :type list)
675    (method-class
676     :initarg :method-class
677     :accessor generic-function-method-class)
678    (method-combination
679     :initarg :method-combination
680     :accessor generic-function-method-combination)
681    (declarations
682     ;; KLUDGE: AMOP specifies :DECLARATIONS, while ANSI specifies
683     ;; :DECLARE.  Allow either (but FIXME: maybe a note or a warning
684     ;; might be appropriate).
685     :initarg :declarations
686     :initarg :declare
687     :initform ()
688     :accessor generic-function-declarations)
689    (arg-info
690     :initform (make-arg-info)
691     :reader gf-arg-info)
692    (dfun-state
693     :initform ()
694     :accessor gf-dfun-state))
695   (:metaclass funcallable-standard-class)
696   (:default-initargs :method-class *the-class-standard-method*
697                      :method-combination *standard-method-combination*))
698
699 (defclass method-combination (standard-object)
700   ((documentation
701     :reader method-combination-documentation
702     :initform nil
703     :initarg :documentation)))
704
705 (defclass standard-method-combination (definition-source-mixin
706                                        method-combination)
707   ((type
708     :reader method-combination-type
709     :initarg :type)
710    (options
711     :reader method-combination-options
712     :initarg :options)))
713
714 (defclass long-method-combination (standard-method-combination)
715   ((function
716     :initarg :function
717     :reader long-method-combination-function)
718    (args-lambda-list
719     :initarg :args-lambda-list
720     :reader long-method-combination-args-lambda-list)))
721
722 (defparameter *early-class-predicates*
723   '((specializer specializerp)
724     (exact-class-specializer exact-class-specializer-p)
725     (class-eq-specializer class-eq-specializer-p)
726     (eql-specializer eql-specializer-p)
727     (class classp)
728     (slot-class slot-class-p)
729     (std-class std-class-p)
730     (standard-class standard-class-p)
731     (funcallable-standard-class funcallable-standard-class-p)
732     (condition-class condition-class-p)
733     (structure-class structure-class-p)
734     (forward-referenced-class forward-referenced-class-p)
735     (method method-p)
736     (standard-method standard-method-p)
737     (standard-accessor-method standard-accessor-method-p)
738     (standard-reader-method standard-reader-method-p)
739     (standard-writer-method standard-writer-method-p)
740     (standard-boundp-method standard-boundp-method-p)
741     (generic-function generic-function-p)
742     (standard-generic-function standard-generic-function-p)
743     (method-combination method-combination-p)
744     (long-method-combination long-method-combination-p)))
745