Fix (setf documentation) regression.
authorStas Boukarev <stassats@gmail.com>
Tue, 5 Feb 2013 15:25:46 +0000 (19:25 +0400)
committerStas Boukarev <stassats@gmail.com>
Tue, 5 Feb 2013 15:25:46 +0000 (19:25 +0400)
When built with sb-doc enabled (the default), it crashes the build
because it uses a not yet defined function, sb-impl::fun-name.

Reported by Janis Dzerins.

src/pcl/documentation.lisp

index 7521653..65d9485 100644 (file)
       (setf (slot-value x '%documentation) new-value)
       (setf (%fun-doc x) new-value)))
 
+;;; FIXME: There's already fun-name in code/describe.lisp, but it's
+;;; loaded after PCL, so it cannot be used, because we set
+;;; some documentation at the end of this file.
+(defun fun-name (x)
+  (if (typep x 'generic-function)
+      (sb-pcl:generic-function-name x)
+      (%fun-name x)))
+
 (defun real-function-name (name)
   ;; Resolve the actual name of the function named by NAME
   ;; e.g. (setf (name-function 'x) #'car)
@@ -34,7 +42,7 @@
                 (eq (car name) 'macro-function)
                 (cadr name))))
         (t
-         (sb-impl::fun-name (fdefinition name)))))
+         (fun-name (fdefinition name)))))
 
 (defun set-function-name-documentation (name documentation)
   (cond ((not (legal-fun-name-p name))