added a clear-class-attributes method, and added it to set-default-attributes so...
authorDrew Crampsie <drewc@tech.coop>
Thu, 7 Jul 2005 02:45:19 +0000 (19:45 -0700)
committerDrew Crampsie <drewc@tech.coop>
Thu, 7 Jul 2005 02:45:19 +0000 (19:45 -0700)
darcs-hash:20050707024519-5417e-8cd585f6177ec1100b368850edb71c2886f2bd32.gz

src/mewa/mewa.lisp

index 54ab29d..70cce96 100644 (file)
@@ -65,6 +65,9 @@ attributes is an alist keyed on the attribute nreeame."
 (defmethod find-class-attributes ((model symbol))
   (find-or-create-attributes model))
 
+(defmethod clear-class-attributes ((model t))
+  (setf (cdr (find-class-attributes model)) nil))
+
 (defmethod add-attribute ((model t) name def)
   (let ((map (find-class-attributes model)))
     (setf (cdr map) (acons name def (cdr map)))))
@@ -113,6 +116,7 @@ attributes is an alist keyed on the attribute nreeame."
                  (meta-model:list-has-many model))))
 
 (defmethod set-default-attributes ((model t))
+  (clear-class-attributes model)
   (mapcar #'(lambda (x) 
              (setf (find-attribute model (car x)) (cdr x)))
          (default-attributes model)))