Properties are special now!
[clinton/lisp-on-lines.git] / src / description-class.lisp
index 5297dfd..0669167 100644 (file)
@@ -33,7 +33,7 @@
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (defparameter *defined-descriptions* nil))
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (defparameter *defined-descriptions* nil))
 
-(defclass description-access-class (standard-layer-class contextl::special-layered-access-class )
+(define-layered-class description-access-class (standard-layer-class contextl::special-layered-access-class )
   ((defined-in-descriptions :initarg :in-description)
    (mixin-class-p :initarg :mixinp)))
 
   ((defined-in-descriptions :initarg :in-description)
    (mixin-class-p :initarg :mixinp)))
 
@@ -68,7 +68,8 @@
             (superclass standard-class))
   t)
 
             (superclass standard-class))
   t)
 
-(defclass standard-description-object (standard-layer-object) ())
+(defclass standard-description-object (standard-layer-object) 
+  ())
 
 (defun description-class-name  (description-class)
     (read-from-string (symbol-name (class-name description-class))))
 
 (defun description-class-name  (description-class)
     (read-from-string (symbol-name (class-name description-class))))
@@ -82,7 +83,7 @@
 ;;; For now. --drewc
 
   (pushnew class *defined-descriptions*)
 ;;; For now. --drewc
 
   (pushnew class *defined-descriptions*)
-  
+
 ;;; ENDHACK.
 
   (let* ((description (find-layer class)) 
 ;;; ENDHACK.
 
   (let* ((description (find-layer class)) 
                            (find (slot-definition-name direct-slot) 
                                  attribute-objects 
                                  :key #'attribute-name)))
                            (find (slot-definition-name direct-slot) 
                                  attribute-objects 
                                  :key #'attribute-name)))
-                      (dprint "Re-initing")
-                      (apply #'reinitialize-instance attribute 
-                             (print (direct-attribute-properties direct-slot)))
-                      (when (not (eq (find-class (attribute-class attribute))
-                                 (class-of attribute)))
+                      (let ((initargs 
+                             (prepare-initargs attribute (direct-attribute-properties direct-slot))))
+                        
+                        (apply #'reinitialize-instance attribute 
+                               initargs )
+                        (when (not (eq (find-class (attribute-class attribute))
+                                       (class-of attribute)))
                           
                           (apply #'change-class attribute  (attribute-class attribute) 
                           
                           (apply #'change-class attribute  (attribute-class attribute) 
-                                 (direct-attribute-properties direct-slot)))
+                                 initargs)))
                       
 
                       (setf (slot-value description (attribute-name attribute))
                       
 
                       (setf (slot-value description (attribute-name attribute))