From 388cdfeef397912ad0453764c291bd49c0d8a9bc Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Wed, 22 May 2013 21:54:14 +0200 Subject: [PATCH] MAKE-INSTANCE now works with structures, too --- src/CHANGELOG | 3 +++ src/clos/builtin.lsp | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/CHANGELOG b/src/CHANGELOG index f5f26a60f..5c87da901 100755 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -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 *** diff --git a/src/clos/builtin.lsp b/src/clos/builtin.lsp index 3fcc14f1f..6c3c2c132 100644 --- a/src/clos/builtin.lsp +++ b/src/clos/builtin.lsp @@ -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)