MAKE-INSTANCE now works with structures, too

This commit is contained in:
Juan Jose Garcia Ripoll 2013-05-22 21:54:14 +02:00
parent 1c363e4dc3
commit 388cdfeef3
2 changed files with 6 additions and 2 deletions

View file

@ -88,6 +88,9 @@ ECL 13.5.1
- ASDF upgraded to version 2.32, including the ASDF-BUNDLE facility, which
supersedes ECL's own implementation of precompiled libraries.
- MAKE-INSTANCE, SHARED-INITIALIZE, REINITIALIZE-INSTANCE now work on
structures as well.
;;; Local Variables: ***
;;; mode:text ***
;;; fill-column:79 ***

View file

@ -73,9 +73,10 @@
;;;
;;; structure-classes cannot be instantiated
(defmethod make-instance ((class structure-class) &rest initargs)
(defmethod allocate-instance ((class structure-class) &rest initargs)
(declare (ignore initargs))
(error "The structure-class (~A) cannot be instantiated" class))
(apply #'si::make-structure class
(make-list (class-size class)) :initial-element (si::unbound)))
(defmethod finalize-inheritance ((class structure-class))
(call-next-method)