X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Fslots.lisp;h=24de706eaf1eafa918df73e7db6b9a45903cb723;hb=5e291412ff095a2016388eee8ac265e12d565119;hp=7cae74222d5c596293d22c4f2a3c618c81778bd3;hpb=b305d276b905654e4877cc49d03a2d3c9187cdff;p=sbcl.git diff --git a/src/pcl/slots.lisp b/src/pcl/slots.lisp index 7cae742..24de706 100644 --- a/src/pcl/slots.lisp +++ b/src/pcl/slots.lisp @@ -331,9 +331,13 @@ (cons (car position)))))) +;;; FIXME: AMOP says that allocate-instance imples finalize-inheritance +;;; if the class is not yet finalized, but we don't seem to be taking +;;; care of this for non-standard-classes.x (defmethod allocate-instance ((class standard-class) &rest initargs) (declare (ignore initargs)) - (unless (class-finalized-p class) (finalize-inheritance class)) + (unless (class-finalized-p class) + (finalize-inheritance class)) (allocate-standard-instance (class-wrapper class))) (defmethod allocate-instance ((class structure-class) &rest initargs) @@ -341,8 +345,14 @@ (let ((constructor (class-defstruct-constructor class))) (if constructor (funcall constructor) - (error "can't allocate an instance of class ~S" (class-name class))))) + (allocate-standard-instance (class-wrapper class))))) +;;; FIXME: It would be nicer to have allocate-instance return +;;; uninitialized objects for conditions as well. (defmethod allocate-instance ((class condition-class) &rest initargs) (declare (ignore initargs)) (make-condition (class-name class))) + +(defmethod allocate-instance ((class built-in-class) &rest initargs) + (declare (ignore initargs)) + (error "Cannot allocate an instance of ~S." class)) ; So sayeth AMOP