[armedbear-cvs] r13928 - trunk/abcl/src/org/armedbear/lisp

rschlatte at common-lisp.net rschlatte at common-lisp.net
Sat May 5 14:05:31 UTC 2012


Author: rschlatte
Date: Sat May  5 07:05:28 2012
New Revision: 13928

Log:
Better error reporting involving partially-initialized class metaobjects

Modified:
   trunk/abcl/src/org/armedbear/lisp/print-object.lisp

Modified: trunk/abcl/src/org/armedbear/lisp/print-object.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/print-object.lisp	Sat May  5 00:02:01 2012	(r13927)
+++ trunk/abcl/src/org/armedbear/lisp/print-object.lisp	Sat May  5 07:05:28 2012	(r13928)
@@ -52,7 +52,13 @@
   (print-unreadable-object (class stream :identity t)
     (format stream "~S ~S"
             (class-name (class-of class))
-            (class-name class)))
+            ;; Handle partially-initialized class metaobjects
+            ;; gracefully; useful for error reporting.
+            (cond ((not (slot-exists-p class 'name))
+                   "(a class object without name slot)")
+                  ((not (slot-boundp class 'name))
+                   "(a class object with unset name)")
+                  (t (class-name class)))))
   class)
 
 (defmethod print-object ((gf generic-function) stream)




More information about the armedbear-cvs mailing list