STRUCTURE-CLASS and STRUCTURE-OBJECT are now created at boot time

This commit is contained in:
Juan Jose Garcia Ripoll 2012-10-07 16:03:40 +02:00
parent 6bb1155f84
commit 9db8116248
2 changed files with 21 additions and 18 deletions

View file

@ -72,16 +72,6 @@
;;; STRUCTURES
;;;
(defclass structure-class (class)
(slot-descriptions
initial-offset
defstruct-form
constructors
documentation
copier
predicate
print-function))
;;; structure-classes cannot be instantiated
(defmethod make-instance ((class structure-class) &rest initargs)
(declare (ignore initargs))
@ -93,14 +83,6 @@
(unless (eq :INSTANCE (slot-definition-allocation slot))
(error "The structure class ~S can't have shared slots" (class-name class)))))
;;; ----------------------------------------------------------------------
;;; Structure-object
;;;
;;; Structure-object has no slots and inherits only from t:
(defclass structure-object (t) ()
(:metaclass structure-class))
(defmethod make-load-form ((object structure-object) &optional environment)
(make-load-form-saving-slots object :key environment))

View file

@ -85,6 +85,21 @@
(optimize-slot-access)
(forward)))))
;;; ----------------------------------------------------------------------
;;; STRUCTURE-CLASS
(eval-when (:compile-toplevel :execute)
(defparameter +structure-class-slots+
(append +class-slots+
'((slot-descriptions)
(initial-offset)
(defstruct-form)
(constructors)
(documentation)
(copier)
(predicate)
(print-function)))))
;;; ----------------------------------------------------------------------
;;; STANDARD-GENERIC-FUNCTION
@ -290,5 +305,11 @@
(standard-writer-method
:direct-superclasses (standard-accessor-method)
:direct-slots #2#)
(structure-class
:direct-superclasses (class)
:direct-slots #.+structure-class-slots+)
(structure-object
:metaclass structure-class
:direct-superclasses (t))
)))