diff src/main.mlton.sml @ 2209:0ca11d57c175

Cleans up interface (it's now a command line option) and renames project to "sqlcache" in the all-one-word style. Still has issues to do with concurrency, retrying transactions, and foreign function calls that either rely on state or have side effects.
author Ziv Scully <ziv@mit.edu>
date Sat, 31 May 2014 03:08:16 -0400
parents 057b08253a75
children 639e62ca2530
line wrap: on
line diff
--- a/src/main.mlton.sml	Fri May 30 12:00:44 2014 -0400
+++ b/src/main.mlton.sml	Sat May 31 03:08:16 2014 -0400
@@ -16,7 +16,7 @@
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
@@ -47,6 +47,7 @@
                   Elaborate.unifyMore := false;
                   Compiler.dumpSource := false;
                   Compiler.doIflow := false;
+                  Compiler.doSqlcache := false;
                   Demo.noEmacs := false;
                   Settings.setDebug false)
 
@@ -64,7 +65,7 @@
         fun doArgs args =
             case args of
                 [] => ()
-              | "-version" :: rest => 
+              | "-version" :: rest =>
                   printVersion ()
               | "-numeric-version" :: rest =>
                   printNumericVersion ()
@@ -159,6 +160,9 @@
               | "-iflow" :: rest =>
                 (Compiler.doIflow := true;
                  doArgs rest)
+              | "-sqlcache" :: rest =>
+                (Compiler.doSqlcache := true;
+                 doArgs rest)
               | "-moduleOf" :: fname :: _ =>
                 (print (Compiler.moduleOf fname ^ "\n");
                  raise Code OS.Process.success)
@@ -306,7 +310,7 @@
                               (* Redirect the daemon's output to the socket. *)
                               redirect Posix.FileSys.stdout;
                               redirect Posix.FileSys.stderr;
-                              
+
                               loop' ("", []);
                               Socket.close sock;
 
@@ -325,7 +329,7 @@
                       loop ()
                   end)
            | ["daemon", "stop"] =>
-	     (OS.FileSys.remove socket handle OS.SysErr _ => OS.Process.exit OS.Process.success) 
+	     (OS.FileSys.remove socket handle OS.SysErr _ => OS.Process.exit OS.Process.success)
            | args =>
              let
                  val sock = UnixSock.Strm.socket ()