0.8.12.8: Really this time. Note to self: remeber to save the
[sbcl.git] / src / pcl / braid.lisp
index 066e6c4..9aec60e 100644 (file)
@@ -97,8 +97,7 @@
 (defmacro !initial-classes-and-wrappers (&rest classes)
   `(progn
      ,@(mapcar (lambda (class)
-                (let ((wr (intern (format nil "~A-WRAPPER" class)
-                                  *pcl-package*)))
+                (let ((wr (format-symbol *pcl-package* "~A-WRAPPER" class)))
                   `(setf ,wr ,(if (eq class 'standard-generic-function)
                                   '*sgf-wrapper*
                                   `(boot-make-wrapper
                                   (boot-make-wrapper (length slots) name))))
                   (proto nil))
              (when (eq name t) (setq *the-wrapper-of-t* wrapper))
-             (set (intern (format nil "*THE-CLASS-~A*" (symbol-name name))
-                          *pcl-package*)
-                  class)
+             (set (make-class-symbol name) class)
              (dolist (slot slots)
                (unless (eq (getf slot :allocation :instance) :instance)
                  (error "Slot allocation ~S is not supported in bootstrap."
     (set-slot 'wrapper wrapper)
     (set-slot 'predicate-name (or (cadr (assoc name *early-class-predicates*))
                                  (make-class-predicate-name name)))
+    (set-slot 'documentation nil)
     (set-slot 'plist
              `(,@(and direct-default-initargs
                       `(direct-default-initargs ,direct-default-initargs))
                        (list class-name)
                        (list class-name)
                        "automatically generated boundp method")))
-    (let ((gf (ensure-generic-function accessor-name)))
+    (let ((gf (ensure-generic-function accessor-name
+                                      :lambda-list arglist)))
       (if (find specls (early-gf-methods gf)
                :key #'early-method-specializers
                :test 'equal)
 (pushnew 'maybe-reinitialize-structure-class sb-kernel::*defstruct-hooks*)
 \f
 (defun make-class-predicate (class name)
-  (let* ((gf (ensure-generic-function name))
+  (let* ((gf (ensure-generic-function name :lambda-list '(object)))
         (mlist (if (eq *boot-state* 'complete)
                    (generic-function-methods gf)
                    (early-gf-methods gf))))
          ~I~_when called with arguments ~2I~_~S.~:>"
         generic-function
         args))
+
+(defmethod invalid-qualifiers ((gf generic-function)
+                              combin
+                              method)
+  (let ((qualifiers (method-qualifiers method)))
+    (let ((why (cond
+                ((cdr qualifiers) "has too many qualifiers")
+                (t (aver (not (member (car qualifiers)
+                                      '(:around :before :after))))
+                   "has an invalid qualifier"))))
+      (invalid-method-error
+       method
+       "The method ~S on ~S ~A.~%~
+        Standard method combination requires all methods to have one~%~
+        of the single qualifiers :AROUND, :BEFORE and :AFTER or to~%~
+        have no qualifier at all."
+       method gf why))))