0.pre7.49:
[sbcl.git] / src / pcl / low.lisp
index e825431..0fd9df5 100644 (file)
 ;;; In all cases, SET-FUNCTION-NAME must return the new (or same)
 ;;; function. (Unlike other functions to set stuff, it does not return
 ;;; the new value.)
-;;;
-;;; FIXME: A similar operation is done in
-;;; TRY-TO-RENAME-INTERPRETED-FUNCTION-AS-MACRO. The code should be
-;;; shared.
 (defun set-function-name (fcn new-name)
   #+sb-doc
   "Set the name of a compiled function object. Return the function."
                 (typep fcn 'generic-function)
                 (eq (class-of fcn) *the-class-standard-generic-function*))
             (setf (sb-kernel:%funcallable-instance-info fcn 1) new-name)
-            (etypecase fcn
-              (sb-kernel:byte-closure
-               (set-function-name (sb-kernel:byte-closure-function fcn)
-                                  new-name))
-              (sb-kernel:byte-function
-               (setf (sb-kernel:byte-function-name fcn) new-name))
-              #+sb-interpreter
-              (sb-eval:interpreted-function
-               (setf (sb-eval:interpreted-function-name fcn) new-name))))
+            (error 'simple-type-error
+                   :datum fcn
+                   :expected-type 'generic-function
+                   :format-control "internal error: bad function type"))
         fcn)
        (t
         ;; pw-- This seems wrong and causes trouble. Tests show
   (sb-kernel:dsd-name slotd))
 
 (defun structure-slotd-accessor-symbol (slotd)
-  (sb-kernel:dsd-accessor slotd))
+  (sb-kernel:dsd-accessor-name slotd))
 
 (defun structure-slotd-reader-function (slotd)
-  (fdefinition (sb-kernel:dsd-accessor slotd)))
+  (fdefinition (sb-kernel:dsd-accessor-name slotd)))
 
 (defun structure-slotd-writer-function (slotd)
   (unless (sb-kernel:dsd-read-only slotd)
-    (fdefinition `(setf ,(sb-kernel:dsd-accessor slotd)))))
+    (fdefinition `(setf ,(sb-kernel:dsd-accessor-name slotd)))))
 
 (defun structure-slotd-type (slotd)
   (sb-kernel:dsd-type slotd))