(cons
(car position))))))
\f
+;;; 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)
(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