Update of /project/elephant/cvsroot/elephant/src In directory common-lisp.net:/tmp/cvs-serv12648/src
Modified Files: controller.lisp Log Message: fixed macros
Date: Sat Sep 4 10:16:56 2004 Author: blee
Index: elephant/src/controller.lisp diff -u elephant/src/controller.lisp:1.7 elephant/src/controller.lisp:1.8 --- elephant/src/controller.lisp:1.7 Thu Sep 2 16:42:38 2004 +++ elephant/src/controller.lisp Sat Sep 4 10:16:55 2004 @@ -157,12 +157,13 @@ (setf (controller-environment sc) nil) nil)
-(defmacro with-open-controller ((&optional (sc *store-controller*)) +(defmacro with-open-controller ((&optional (sc '*store-controller*)) &body body) `(unwind-protect (progn - (open-controller ,sc) - ,@body) + (let (*store-controller* (open-controller ,sc)) + (declare (special *store-controller*)) + ,@body)) (close-controller ,sc)))
(defun open-store (path) @@ -170,4 +171,16 @@ (open-controller *store-controller*))
(defun close-store () - (close-controller *store-controller*)) \ No newline at end of file + (close-controller *store-controller*)) + +(defmacro with-open-store ((path) &body body) + (let ((sc (gensym))) + `(let ((,sc (make-instance 'store-controller :path ,path))) + (unwind-protect + (progn + (let ((*store-controller* ,sc)) + (declare (special *store-controller*)) + (open-controller *store-controller*) + ,@body)) + (close-controller ,sc))))) +