[MLton-commit] r7068

Matthew Fluet fluet at mlton.org
Wed Apr 8 05:33:09 PDT 2009


Don't reference SMLofNJ structure in Main.
----------------------------------------------------------------------

U   mlton/trunk/mlton/Makefile
U   mlton/trunk/mlton/call-main.sml
A   mlton/trunk/mlton/main/export.sig
A   mlton/trunk/mlton/main/export.sml
U   mlton/trunk/mlton/main/main.fun
U   mlton/trunk/mlton/main/main.sig
U   mlton/trunk/mlton/main/sources.cm
U   mlton/trunk/mlton/main/sources.mlb

----------------------------------------------------------------------

Modified: mlton/trunk/mlton/Makefile
===================================================================
--- mlton/trunk/mlton/Makefile	2009-04-08 12:33:03 UTC (rev 7067)
+++ mlton/trunk/mlton/Makefile	2009-04-08 12:33:07 UTC (rev 7068)
@@ -117,7 +117,7 @@
 		echo '#set CM.Control.warn_obsolete false;';			\
 		echo 'Control.polyEqWarn := false;';				\
 		echo 'CM.make "sources.cm";';					\
-		echo 'Main.exportNJ ("$(LIB)/mlton");'	\
+		echo 'Export.exportNJ("$(LIB)/mlton");'				\
 	) | "$(SML)"
 
 .PHONY: nj-mlton-dual
@@ -130,7 +130,7 @@
 		echo 'val _ = CM.Server.start {cmd = (CommandLine.name (), ["@CMslave"]), name = "server1", pathtrans = NONE, pref = 0};';\
 		echo 'val _ = CM.Server.start {cmd = (CommandLine.name (), ["@CMslave"]), name = "server2", pathtrans = NONE, pref = 0};';\
 		echo 'CM.make "sources.cm";';					\
-		echo 'Main.exportNJ ("$(LIB)/mlton");'	\
+		echo 'Export.exportNJ("$(LIB)/mlton");'				\
 	) | "$(SML)"
 
 .PHONY: nj-mlton-quad
@@ -145,7 +145,7 @@
 		echo 'val _ = CM.Server.start {cmd = (CommandLine.name (), ["@CMslave"]), name = "server3", pathtrans = NONE, pref = 0};';\
 		echo 'val _ = CM.Server.start {cmd = (CommandLine.name (), ["@CMslave"]), name = "server4", pathtrans = NONE, pref = 0};';\
 		echo 'CM.make "sources.cm";';					\
-		echo 'Main.exportNJ ("$(LIB)/mlton");'	\
+		echo 'Export.exportNJ("$(LIB)/mlton");'				\
 	) | "$(SML)"
 
 .PHONY: nj-whole
@@ -154,14 +154,19 @@
 		echo 'SMLofNJ.Internals.GC.messages false;';			\
 		echo '#set CM.Control.verbose false;';				\
 		echo '#set CM.Control.warn_obsolete false;';			\
-		echo 'Control.polyEqWarn := false;';				\
-		echo 'local';							\
-		cmcat sources.cm | grep 'mlton-stubs-in-smlnj' | xargs cat;	\
+		echo 'Control.polyEqWarn := false;'; 				\
+		echo 'local'; 							\
+		cmcat sources.cm | grep 'basis-stubs-for-smlnj' | xargs cat;	\
 		cmcat sources.cm | grep 'mlyacc' | xargs cat;			\
-		cmcat sources.cm | grep -v 'mlyacc' |				\
-			grep -v 'mlton-stubs-in-smlnj' | xargs cat;		\
+		cmcat sources.cm | grep 'mlton-stubs-for-smlnj' | xargs cat;	\
+		cmcat sources.cm | grep 'mlton-stubs' | xargs cat;		\
+		cmcat sources.cm | 						\
+			grep -v 'basis-stubs-for-smlnj' |			\
+			grep -v 'mlyacc' |					\
+			grep -v 'mlton-stubs-for-smlnj' |			\
+			grep -v 'mlton-stubs' | xargs cat;	 		\
 		echo 'in';							\
-		echo 'val _ = Main.exportNJ ("$(SRC)/basis-library", "$(LIB)/mlton")';	\
+		echo 'Export.exportNJ("$(LIB)/mlton");'				\
 		echo 'end';							\
 	) >mlton.whole.sml
 	"$(SML)" <mlton.whole.sml

Modified: mlton/trunk/mlton/call-main.sml
===================================================================
--- mlton/trunk/mlton/call-main.sml	2009-04-08 12:33:03 UTC (rev 7067)
+++ mlton/trunk/mlton/call-main.sml	2009-04-08 12:33:07 UTC (rev 7068)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -6,4 +7,4 @@
  * See the file MLton-LICENSE for details.
  *)
 
-val _ = Main.exportMLton ()
+val _ = Export.exportMLton ()

Added: mlton/trunk/mlton/main/export.sig
===================================================================
--- mlton/trunk/mlton/main/export.sig	2009-04-08 12:33:03 UTC (rev 7067)
+++ mlton/trunk/mlton/main/export.sig	2009-04-08 12:33:07 UTC (rev 7068)
@@ -0,0 +1,11 @@
+(* Copyright (C) 2009 Matthew Fluet.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+signature EXPORT =
+   sig
+      val exportMLton: unit -> unit
+      val exportNJ: File.t -> unit
+   end

Added: mlton/trunk/mlton/main/export.sml
===================================================================
--- mlton/trunk/mlton/main/export.sml	2009-04-08 12:33:03 UTC (rev 7067)
+++ mlton/trunk/mlton/main/export.sml	2009-04-08 12:33:07 UTC (rev 7068)
@@ -0,0 +1,18 @@
+(* Copyright (C) 2009 Matthew Fluet.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Export : EXPORT =
+   struct
+
+      fun exportNJ (file: File.t): unit =
+         SMLofNJ.exportFn (file, Main.main)
+
+      fun exportMLton (): unit =
+         case CommandLine.arguments () of
+            [worldFile] =>
+               SMLofNJ.exportFn (worldFile, Main.main)
+          | _ => Error.bug "usage: exportMLton worldFile"
+   end

Modified: mlton/trunk/mlton/main/main.fun
===================================================================
--- mlton/trunk/mlton/main/main.fun	2009-04-08 12:33:03 UTC (rev 7067)
+++ mlton/trunk/mlton/main/main.fun	2009-04-08 12:33:07 UTC (rev 7068)
@@ -1538,13 +1538,6 @@
 
 val commandLine = Process.makeCommandLine commandLine
 
-fun exportNJ (file: File.t): unit =
-   SMLofNJ.exportFn (file, fn (_, args) => commandLine args)
+val main = fn (_, args) => commandLine args
 
-fun exportMLton (): unit =
-   case CommandLine.arguments () of
-      [worldFile] =>
-         SMLofNJ.exportFn (worldFile, fn (_, args) => commandLine args)
-    | _ => Error.bug "usage: exportMLton worldFile"
-
 end

Modified: mlton/trunk/mlton/main/main.sig
===================================================================
--- mlton/trunk/mlton/main/main.sig	2009-04-08 12:33:03 UTC (rev 7067)
+++ mlton/trunk/mlton/main/main.sig	2009-04-08 12:33:07 UTC (rev 7068)
@@ -15,7 +15,5 @@
    sig
       include MAIN_STRUCTS
 
-      val commandLine: string list -> OS.Process.status
-      val exportMLton: unit -> unit
-      val exportNJ: File.t -> unit
+      val main: string * string list -> OS.Process.status
    end

Modified: mlton/trunk/mlton/main/sources.cm
===================================================================
--- mlton/trunk/mlton/main/sources.cm	2009-04-08 12:33:03 UTC (rev 7067)
+++ mlton/trunk/mlton/main/sources.cm	2009-04-08 12:33:07 UTC (rev 7068)
@@ -10,6 +10,7 @@
 Group
 
 structure Main
+structure Export
 
 is
 
@@ -35,3 +36,5 @@
 main.sig
 main.fun
 main.sml
+export.sig
+export.sml

Modified: mlton/trunk/mlton/main/sources.mlb
===================================================================
--- mlton/trunk/mlton/main/sources.mlb	2009-04-08 12:33:03 UTC (rev 7067)
+++ mlton/trunk/mlton/main/sources.mlb	2009-04-08 12:33:07 UTC (rev 7068)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -29,6 +30,9 @@
    main.sig
    main.fun
    main.sml
+   export.sig
+   export.sml
 in
    structure Main
+   structure Export
 end




More information about the MLton-commit mailing list