Proper handling of Apache log file deletion while Apache might have that file open
[hcoop/domtool2.git] / src / eval.sml
index c05d781..7aa8053 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Execution of Domtool programs reduced to primitive actions *)
 
@@ -30,6 +30,11 @@ fun lookup (evs, ev) =
                            ^ ev ^ " that type-checking has guaranteed")
       | SOME v => v
 
+fun printEvs (name, evs) =
+    (print ("Environment " ^ name ^ "\n");
+     SM.appi (fn (name, i) => Print.preface (name, Print.p_exp i)) evs;
+     print "\n")
+
 val conjoin : Env.env_vars * Env.env_vars -> Env.env_vars =
   SM.unionWith #2
 
@@ -90,7 +95,7 @@ fun exec evs e =
                            val evs'' = exec' evs e2
                        in
                            cleanup ();
-                           conjoin (conjoin (evs, evs'), evs'')
+                           evs'
                        end
                end
 
@@ -103,9 +108,10 @@ fun exec evs e =
                      | SOME action => action (evs, args)
                end
 
+       val _ = Env.pre ()
        val evs' = exec' evs e
     in
-       ()
+       Env.post ()
     end
 
 end