From 632e208a5c0584940287c40defa4f490e1559fc2 Mon Sep 17 00:00:00 2001 From: Juanjo Garcia-Ripoll Date: Fri, 5 Oct 2012 16:00:04 +0200 Subject: [PATCH] Builtin in classes are now also created in boot.lsp --- src/clos/boot.lsp | 11 +++++++++-- src/clos/builtin.lsp | 16 +++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/clos/boot.lsp b/src/clos/boot.lsp index 3dce6e0c2..436de778b 100644 --- a/src/clos/boot.lsp +++ b/src/clos/boot.lsp @@ -106,8 +106,9 @@ collect (canonical-slot-to-direct-slot nil s)))) (eval-when (eval) (defconstant +class-hierarchy+ - '((standard-class) ; Special-cased below + `((standard-class) ; Special-cased below (t + :index 0 :metaclass standard-class) (standard-object :metaclass standard-class @@ -151,7 +152,13 @@ (funcallable-standard-class :metaclass standard-class :direct-superclasses (std-class) - :direct-slots #1#)))) + :direct-slots #1#) + ,@(loop for (name . rest) in +builtin-classes-list+ + for index from 1 + collect (list name :metaclass 'built-in-class + :index index + :direct-superclasses (or rest '(t)))) + ))) ;;; ---------------------------------------------------------------------- ;;; Building the classes T, CLASS, STANDARD-OBJECT and STANDARD-CLASS. diff --git a/src/clos/builtin.lsp b/src/clos/builtin.lsp index 10b71b333..4b02e7d9e 100644 --- a/src/clos/builtin.lsp +++ b/src/clos/builtin.lsp @@ -22,17 +22,11 @@ (declare (ignore initargs)) (error "The built-in class (~A) cannot be instantiated" class)) -(loop for (name . rest) in '#.+builtin-classes-list+ - for index from 1 - with built-in-class = (find-class 'built-in-class) - with array = +builtin-classes-pre-array+ - do (let* ((direct-superclasses (mapcar #'find-class (or rest '(t)))) - (class (make-instance built-in-class :name name - :direct-superclasses direct-superclasses - :direct-slots nil))) - (setf (find-class name) class - (aref array index) class)) - finally (si::*make-constant '+builtin-classes+ array)) +;;; +;;; At this point we can activate the vector of builtin classes, which +;;; is used by class-of and other functions. +;;; +(si::*make-constant '+builtin-classes+ +builtin-classes-pre-array+) (defmethod ensure-class-using-class ((class null) name &rest rest) (declare (ignore class))