X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Fmacros.lisp;h=ad4e24f7dcd2173f83c55731043a2f267e7cd65a;hb=224a1ad2a321173725bd114bbd67fa426f682c75;hp=f676758830bd11e49182b18973633d52f5a1721f;hpb=310aee0b439b715a5ec242862ab0a4d254e123b5;p=sbcl.git diff --git a/src/pcl/macros.lisp b/src/pcl/macros.lisp index f676758..ad4e24f 100644 --- a/src/pcl/macros.lisp +++ b/src/pcl/macros.lisp @@ -137,11 +137,10 @@ symbol &optional (errorp t) environment) (declare (ignore environment)) (if (and (constantp symbol) - (legal-class-name-p (eval symbol)) + (legal-class-name-p (setf symbol (constant-form-value symbol))) (constantp errorp) (member *boot-state* '(braid complete))) - (let ((symbol (eval symbol)) - (errorp (not (null (eval errorp)))) + (let ((errorp (not (null (constant-form-value errorp)))) (class-cell (make-symbol "CLASS-CELL"))) `(let ((,class-cell (load-time-value (find-class-cell ',symbol)))) (or (find-class-cell-class ,class-cell) @@ -158,10 +157,33 @@ (with-single-package-locked-error (:symbol name "using ~A as the class-name argument in ~ (SETF FIND-CLASS)")) - (let ((cell (find-class-cell name))) + (let* ((cell (find-class-cell name)) + (class (find-class-cell-class cell))) (setf (find-class-cell-class cell) new-value) - (when (and (eq *boot-state* 'complete) (null new-value)) - (setf (find-classoid name) nil)) + (when (eq *boot-state* 'complete) + (if (null new-value) + (progn + (setf (find-classoid name) new-value) + (when class + ;; KLUDGE: This horror comes about essentially + ;; because we use the proper name of a classoid + ;; to do TYPEP, which needs to be available + ;; early, and also to determine whether TYPE-OF + ;; should return the name or the class (using + ;; CLASSOID-PROPER-NAME). So if we are removing + ;; proper nameness, arrange for + ;; CLASSOID-PROPER-NAME to do the right thing + ;; too. (This is almost certainly not the right + ;; solution; instead, CLASSOID-NAME and + ;; FIND-CLASSOID should be direct parallels to + ;; CLASS-NAME and FIND-CLASS, and TYPEP on + ;; not-yet-final classes should be compileable. + (let ((classoid (layout-classoid (slot-value class 'wrapper)))) + (setf (classoid-name classoid) nil)))) + + (let ((classoid (layout-classoid (slot-value new-value 'wrapper)))) + (setf (find-classoid name) classoid) + (set-class-type-translation new-value classoid)))) (when (or (eq *boot-state* 'complete) (eq *boot-state* 'braid)) (update-ctors 'setf-find-class :class new-value :name name)) @@ -169,11 +191,6 @@ (t (error "~S is not a legal class name." name)))) -(/show "pcl/macros.lisp 230") - -(defun find-wrapper (symbol) - (class-wrapper (find-class symbol))) - (/show "pcl/macros.lisp 241") (defmacro function-funcall (form &rest args)