New feature: proper object lifecycle protocol; init and teardown fragments.
[sod] / src / class-make-impl.lisp
index d2f3093..bd2407e 100644 (file)
   nil)
 
 ;;;--------------------------------------------------------------------------
+;;; Initialization and teardown fragments.
+
+(defmethod make-sod-class-initfrag
+    ((class sod-class) frag pset &optional location)
+  (declare (ignore pset location))
+  (with-slots (initfrags) class
+    (setf initfrags (append initfrags (list frag)))))
+
+(defmethod make-sod-class-tearfrag
+    ((class sod-class) frag pset &optional location)
+  (declare (ignore pset location))
+  (with-slots (tearfrags) class
+    (setf tearfrags (append tearfrags (list frag)))))
+
+;;;--------------------------------------------------------------------------
 ;;; Messages.
 
 (defmethod make-sod-message