0.8.8.21:
[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 (intern (format nil
220                                     "*THE-CLASS-~A*"
221                                     (symbol-name class-name))
222                             *pcl-package*)))
223         (push (list class-name symbol) *built-in-class-symbols*)
224         symbol)))
225
226 (defun get-built-in-wrapper-symbol (class-name)
227   (or (cadr (assq class-name *built-in-wrapper-symbols*))
228       (let ((symbol (intern (format nil
229                                     "*THE-WRAPPER-OF-~A*"
230                                     (symbol-name class-name))
231                             *pcl-package*)))
232         (push (list class-name symbol) *built-in-wrapper-symbols*)
233         symbol)))
234 \f
235 (pushnew '%class *var-declarations*)
236 (pushnew '%variable-rebinding *var-declarations*)
237
238 (defun variable-class (var env)
239   (caddr (var-declaration 'class var env)))
240
241 (defvar *name->class->slotd-table* (make-hash-table))
242
243 (defvar *standard-method-combination*)
244 \f
245 (defun make-class-predicate-name (name)
246   (list 'class-predicate name))
247   
248 (defun plist-value (object name)
249   (getf (object-plist object) name))
250
251 (defun (setf plist-value) (new-value object name)
252   (if new-value
253       (setf (getf (object-plist object) name) new-value)
254       (progn
255         (remf (object-plist object) name)
256         nil)))
257 \f
258 ;;;; built-in classes
259
260 ;;; Grovel over SB-KERNEL::*BUILT-IN-CLASSES* in order to set
261 ;;; SB-PCL:*BUILT-IN-CLASSES*.
262 (/show "about to set up SB-PCL::*BUILT-IN-CLASSES*")
263 (defvar *built-in-classes*
264   (labels ((direct-supers (class)
265              (/noshow "entering DIRECT-SUPERS" (classoid-name class))
266              (if (typep class 'built-in-classoid)
267                  (built-in-classoid-direct-superclasses class)
268                  (let ((inherits (layout-inherits
269                                   (classoid-layout class))))
270                    (/noshow inherits)
271                    (list (svref inherits (1- (length inherits)))))))
272            (direct-subs (class)
273              (/noshow "entering DIRECT-SUBS" (classoid-name class))
274              (collect ((res))
275                (let ((subs (classoid-subclasses class)))
276                  (/noshow subs)
277                  (when subs
278                    (dohash (sub v subs)
279                      (declare (ignore v))
280                      (/noshow sub)
281                      (when (member class (direct-supers sub))
282                        (res sub)))))
283                (res))))
284     (mapcar (lambda (kernel-bic-entry)
285               (/noshow "setting up" kernel-bic-entry)
286               (let* ((name (car kernel-bic-entry))
287                      (class (find-classoid name))
288                      (prototype-form
289                       (getf (cdr kernel-bic-entry) :prototype-form)))
290                 (/noshow name class)
291                 `(,name
292                   ,(mapcar #'classoid-name (direct-supers class))
293                   ,(mapcar #'classoid-name (direct-subs class))
294                   ,(map 'list
295                         (lambda (x)
296                           (classoid-name
297                            (layout-classoid x)))
298                         (reverse
299                          (layout-inherits
300                           (classoid-layout class))))
301                   ,(if prototype-form
302                        (eval prototype-form)
303                        ;; This is the default prototype value which
304                        ;; was used, without explanation, by the CMU CL
305                        ;; code we're derived from. Evidently it's safe
306                        ;; in all relevant cases.
307                        42))))
308             (remove-if (lambda (kernel-bic-entry)
309                          (member (first kernel-bic-entry)
310                                  ;; I'm not sure why these are removed from
311                                  ;; the list, but that's what the original
312                                  ;; CMU CL code did. -- WHN 20000715
313                                  '(t instance
314                                      funcallable-instance
315                                      function stream)))
316                        sb-kernel::*built-in-classes*))))
317 (/noshow "done setting up SB-PCL::*BUILT-IN-CLASSES*")
318 \f
319 ;;;; the classes that define the kernel of the metabraid
320
321 (defclass t () ()
322   (:metaclass built-in-class))
323
324 (defclass instance (t) ()
325   (:metaclass built-in-class))
326
327 (defclass function (t) ()
328   (:metaclass built-in-class))
329
330 (defclass funcallable-instance (function) ()
331   (:metaclass built-in-class))
332
333 (defclass stream (instance) ()
334   (:metaclass built-in-class))
335
336 (defclass slot-object (t) ()
337   (:metaclass slot-class))
338
339 (defclass condition (slot-object instance) ()
340   (:metaclass condition-class))
341
342 (defclass structure-object (slot-object instance) ()
343   (:metaclass structure-class))
344
345 (defstruct (dead-beef-structure-object
346             (:constructor |STRUCTURE-OBJECT class constructor|)
347             (:copier nil)))
348
349 (defclass std-object (slot-object) ()
350   (:metaclass std-class))
351
352 (defclass standard-object (std-object instance) ())
353
354 (defclass funcallable-standard-object (std-object funcallable-instance)
355   ()
356   (:metaclass funcallable-standard-class))
357
358 (defclass specializer (standard-object)
359   ((type
360     :initform nil
361     :reader specializer-type)))
362
363 (defclass definition-source-mixin (std-object)
364   ((source
365     :initform *load-pathname*
366     :reader definition-source
367     :initarg :definition-source))
368   (:metaclass std-class))
369
370 (defclass plist-mixin (std-object)
371   ((plist
372     :initform ()
373     :accessor object-plist))
374   (:metaclass std-class))
375
376 (defclass dependent-update-mixin (plist-mixin)
377   ()
378   (:metaclass std-class))
379
380 ;;; The class CLASS is a specified basic class. It is the common
381 ;;; superclass of any kind of class. That is, any class that can be a
382 ;;; metaclass must have the class CLASS in its class precedence list.
383 (defclass class (dependent-update-mixin
384                  definition-source-mixin
385                  specializer)
386   ((name
387     :initform nil
388     :initarg  :name
389     :accessor class-name)
390    (class-eq-specializer
391     :initform nil
392     :reader class-eq-specializer)
393    (direct-superclasses
394     :initform ()
395     :reader class-direct-superclasses)
396    ;; Note: The (CLASS-)DIRECT-SUBCLASSES for STRUCTURE-CLASSes and
397    ;; CONDITION-CLASSes are lazily computed whenever the subclass info
398    ;; becomes available, i.e. when the PCL class is created.
399    (direct-subclasses
400     :initform ()
401     :reader class-direct-subclasses)
402    (direct-methods
403     :initform (cons nil nil))
404    (predicate-name
405     :initform nil
406     :reader class-predicate-name)
407    (documentation
408     :initform nil
409     :initarg :documentation)
410    (finalized-p
411     :initform nil
412     :reader class-finalized-p)))
413
414 (def!method make-load-form ((class class) &optional env)
415   ;; FIXME: should we not instead pass ENV to FIND-CLASS?  Probably
416   ;; doesn't matter while all our environments are the same...
417   (declare (ignore env))
418   (let ((name (class-name class)))
419     (unless (and name (eq (find-class name nil) class))
420       (error "~@<Can't use anonymous or undefined class as constant: ~S~:@>"
421              class))
422     `(find-class ',name)))
423
424 ;;; The class PCL-CLASS is an implementation-specific common
425 ;;; superclass of all specified subclasses of the class CLASS.
426 (defclass pcl-class (class)
427   ((class-precedence-list
428     :reader class-precedence-list)
429    (can-precede-list
430     :initform ()
431     :reader class-can-precede-list)
432    (incompatible-superclass-list
433     :initform ()
434     :accessor class-incompatible-superclass-list)
435    (wrapper
436     :initform nil
437     :reader class-wrapper)
438    (prototype
439     :initform nil
440     :reader class-prototype)))
441
442 (defclass slot-class (pcl-class)
443   ((direct-slots
444     :initform ()
445     :accessor class-direct-slots)
446    (slots
447     :initform ()
448     :accessor class-slots)))
449
450 ;;; The class STD-CLASS is an implementation-specific common
451 ;;; superclass of the classes STANDARD-CLASS and
452 ;;; FUNCALLABLE-STANDARD-CLASS.
453 (defclass std-class (slot-class)
454   ())
455
456 (defclass standard-class (std-class)
457   ())
458
459 (defclass funcallable-standard-class (std-class)
460   ())
461
462 (defclass forward-referenced-class (pcl-class) ())
463
464 (defclass built-in-class (pcl-class) ())
465
466 (defclass condition-class (slot-class) ())
467
468 (defclass structure-class (slot-class)
469   ((defstruct-form
470      :initform ()
471      :accessor class-defstruct-form)
472    (defstruct-constructor
473      :initform nil
474      :accessor class-defstruct-constructor)
475    (from-defclass-p
476     :initform nil
477     :initarg :from-defclass-p)))
478
479 (defclass specializer-with-object (specializer) ())
480
481 (defclass exact-class-specializer (specializer) ())
482
483 (defclass class-eq-specializer (exact-class-specializer
484                                 specializer-with-object)
485   ((object :initarg :class
486            :reader specializer-class
487            :reader specializer-object)))
488
489 (defclass class-prototype-specializer (specializer-with-object)
490   ((object :initarg :class
491            :reader specializer-class
492            :reader specializer-object)))
493
494 (defclass eql-specializer (exact-class-specializer specializer-with-object)
495   ((object :initarg :object :reader specializer-object
496            :reader eql-specializer-object)))
497
498 (defvar *eql-specializer-table* (make-hash-table :test 'eql))
499
500 (defun intern-eql-specializer (object)
501   (or (gethash object *eql-specializer-table*)
502       (setf (gethash object *eql-specializer-table*)
503             (make-instance 'eql-specializer :object object))))
504 \f
505 ;;;; slot definitions
506
507 (defclass slot-definition (standard-object)
508   ((name
509     :initform nil
510     :initarg :name
511     :accessor slot-definition-name)
512    (initform
513     :initform nil
514     :initarg :initform
515     :accessor slot-definition-initform)
516    (initfunction
517     :initform nil
518     :initarg :initfunction
519     :accessor slot-definition-initfunction)
520    (readers
521     :initform nil
522     :initarg :readers
523     :accessor slot-definition-readers)
524    (writers
525     :initform nil
526     :initarg :writers
527     :accessor slot-definition-writers)
528    (initargs
529     :initform nil
530     :initarg :initargs
531     :accessor slot-definition-initargs)
532    (type
533     :initform t
534     :initarg :type
535     :accessor slot-definition-type)
536    (documentation
537     :initform nil
538     :initarg :documentation)
539    (class
540     :initform nil
541     :initarg :class
542     :accessor slot-definition-class)))
543
544 (defclass standard-slot-definition (slot-definition)
545   ((allocation
546     :initform :instance
547     :initarg :allocation
548     :accessor slot-definition-allocation)
549    (allocation-class
550     :initform nil
551     :initarg :allocation-class
552     :accessor slot-definition-allocation-class)))
553
554 (defclass condition-slot-definition (slot-definition)
555   ((allocation
556     :initform :instance
557     :initarg :allocation
558     :accessor slot-definition-allocation)
559    (allocation-class
560     :initform nil
561     :initarg :allocation-class
562     :accessor slot-definition-allocation-class)))
563
564 (defclass structure-slot-definition (slot-definition)
565   ((defstruct-accessor-symbol
566      :initform nil
567      :initarg :defstruct-accessor-symbol
568      :accessor slot-definition-defstruct-accessor-symbol)
569    (internal-reader-function
570      :initform nil
571      :initarg :internal-reader-function
572      :accessor slot-definition-internal-reader-function)
573    (internal-writer-function
574      :initform nil
575      :initarg :internal-writer-function
576      :accessor slot-definition-internal-writer-function)))
577
578 (defclass direct-slot-definition (slot-definition)
579   ())
580
581 (defclass effective-slot-definition (slot-definition)
582   ((reader-function ; (lambda (object) ...)
583     :accessor slot-definition-reader-function)
584    (writer-function ; (lambda (new-value object) ...)
585     :accessor slot-definition-writer-function)
586    (boundp-function ; (lambda (object) ...)
587     :accessor slot-definition-boundp-function)
588    (accessor-flags
589     :initform 0)))
590
591 (defclass standard-direct-slot-definition (standard-slot-definition
592                                            direct-slot-definition)
593   ())
594
595 (defclass standard-effective-slot-definition (standard-slot-definition
596                                               effective-slot-definition)
597   ((location ; nil, a fixnum, a cons: (slot-name . value)
598     :initform nil
599     :accessor slot-definition-location)))
600
601 (defclass condition-direct-slot-definition (condition-slot-definition
602                                             direct-slot-definition)
603   ())
604
605 (defclass condition-effective-slot-definition (condition-slot-definition
606                                                effective-slot-definition)
607   ())
608
609 (defclass structure-direct-slot-definition (structure-slot-definition
610                                             direct-slot-definition)
611   ())
612
613 (defclass structure-effective-slot-definition (structure-slot-definition
614                                                effective-slot-definition)
615   ())
616
617 (defclass method (standard-object) ())
618
619 (defclass standard-method (definition-source-mixin plist-mixin method)
620   ((generic-function
621     :initform nil       
622     :accessor method-generic-function)
623 ;;;     (qualifiers
624 ;;;     :initform ()
625 ;;;     :initarg  :qualifiers
626 ;;;     :reader method-qualifiers)
627    (specializers
628     :initform ()
629     :initarg  :specializers
630     :reader method-specializers)
631    (lambda-list
632     :initform ()
633     :initarg  :lambda-list
634     :reader method-lambda-list)
635    (function
636     :initform nil
637     :initarg :function)                 ;no writer
638    (fast-function
639     :initform nil
640     :initarg :fast-function             ;no writer
641     :reader method-fast-function)
642    (documentation
643     :initform nil
644     :initarg :documentation)))
645
646 (defclass standard-accessor-method (standard-method)
647   ((slot-name :initform nil
648               :initarg :slot-name
649               :reader accessor-method-slot-name)
650    (slot-definition :initform nil
651                     :initarg :slot-definition
652                     :reader accessor-method-slot-definition)))
653
654 (defclass standard-reader-method (standard-accessor-method) ())
655
656 (defclass standard-writer-method (standard-accessor-method) ())
657
658 (defclass standard-boundp-method (standard-accessor-method) ())
659
660 (defclass generic-function (dependent-update-mixin
661                             definition-source-mixin
662                             funcallable-standard-object)
663   ((documentation
664     :initform nil
665     :initarg :documentation)
666    ;; We need to make a distinction between the methods initially set
667    ;; up by :METHOD options to DEFGENERIC and the ones set up later by
668    ;; DEFMETHOD, because ANSI's specifies that executing DEFGENERIC on
669    ;; an already-DEFGENERICed function clears the methods set by the
670    ;; previous DEFGENERIC, but not methods set by DEFMETHOD. (Making
671    ;; this distinction seems a little kludgy, but it has the positive
672    ;; effect of making it so that loading a file a.lisp containing
673    ;; DEFGENERIC, then loading a second file b.lisp containing
674    ;; DEFMETHOD, then modifying and reloading a.lisp and/or b.lisp
675    ;; tends to leave the generic function in a state consistent with
676    ;; the most-recently-loaded state of a.lisp and b.lisp.)
677    (initial-methods
678     :initform ()
679     :accessor generic-function-initial-methods))
680   (:metaclass funcallable-standard-class))
681
682 (defclass standard-generic-function (generic-function)
683   ((name
684     :initform nil
685     :initarg :name
686     :accessor generic-function-name)
687    (methods
688     :initform ()
689     :accessor generic-function-methods
690     :type list)
691    (method-class
692     :initarg :method-class
693     :accessor generic-function-method-class)
694    (method-combination
695     :initarg :method-combination
696     :accessor generic-function-method-combination)
697    (declarations
698     :initarg :declarations
699     :initform ()
700     :accessor generic-function-declarations)
701    (arg-info
702     :initform (make-arg-info)
703     :reader gf-arg-info)
704    (dfun-state
705     :initform ()
706     :accessor gf-dfun-state))
707   (:metaclass funcallable-standard-class)
708   (:default-initargs :method-class *the-class-standard-method*
709                      :method-combination *standard-method-combination*))
710
711 (defclass method-combination (standard-object)
712   ((documentation
713     :reader method-combination-documentation
714     :initform nil
715     :initarg :documentation)))
716
717 (defclass standard-method-combination (definition-source-mixin
718                                        method-combination)
719   ((type
720     :reader method-combination-type
721     :initarg :type)
722    (options
723     :reader method-combination-options
724     :initarg :options)))
725
726 (defclass long-method-combination (standard-method-combination)
727   ((function
728     :initarg :function
729     :reader long-method-combination-function)
730    (args-lambda-list
731     :initarg :args-lambda-list
732     :reader long-method-combination-args-lambda-list)))
733
734 (defparameter *early-class-predicates*
735   '((specializer specializerp)
736     (exact-class-specializer exact-class-specializer-p)
737     (class-eq-specializer class-eq-specializer-p)
738     (eql-specializer eql-specializer-p)
739     (class classp)
740     (slot-class slot-class-p)
741     (std-class std-class-p)
742     (standard-class standard-class-p)
743     (funcallable-standard-class funcallable-standard-class-p)
744     (condition-class condition-class-p)
745     (structure-class structure-class-p)
746     (forward-referenced-class forward-referenced-class-p)
747     (method method-p)
748     (standard-method standard-method-p)
749     (standard-accessor-method standard-accessor-method-p)
750     (standard-reader-method standard-reader-method-p)
751     (standard-writer-method standard-writer-method-p)
752     (standard-boundp-method standard-boundp-method-p)
753     (generic-function generic-function-p)
754     (standard-generic-function standard-generic-function-p)
755     (method-combination method-combination-p)
756     (long-method-combination long-method-combination-p)))
757