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

rschlatte at common-lisp.net rschlatte at common-lisp.net
Sat Jan 28 16:34:47 UTC 2012


Author: rschlatte
Date: Sat Jan 28 08:34:47 2012
New Revision: 13818

Log:
Better error message for (allocate-instance (find-class 'symbol))

Modified:
   trunk/abcl/src/org/armedbear/lisp/clos.lisp

Modified: trunk/abcl/src/org/armedbear/lisp/clos.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/clos.lisp	Sat Jan 28 06:23:51 2012	(r13817)
+++ trunk/abcl/src/org/armedbear/lisp/clos.lisp	Sat Jan 28 08:34:47 2012	(r13818)
@@ -2994,6 +2994,8 @@
 
 ;;; Instance creation and initialization
 
+;;; AMOP pg. 168ff.  Checking whether the class is finalized is done
+;;; inside std-allocate-instance and allocate-funcallable-instance.
 (defgeneric allocate-instance (class &rest initargs &key &allow-other-keys))
 
 (defmethod allocate-instance ((class standard-class) &rest initargs)
@@ -3010,6 +3012,10 @@
                    (make-list (length (class-slots class))
                               :initial-element +slot-unbound+)))
 
+(defmethod allocate-instance ((class built-in-class) &rest initargs)
+  (declare (ignore initargs))
+  (error "Cannot allocate instances of a built-in class: ~S" class))
+
 ;; "The set of valid initialization arguments for a class is the set of valid
 ;; initialization arguments that either fill slots or supply arguments to
 ;; methods, along with the predefined initialization argument :ALLOW-OTHER-KEYS."




More information about the armedbear-cvs mailing list