[MLton-commit] r6538

Matthew Fluet fluet at mlton.org
Mon Apr 7 11:33:17 PDT 2008


Use ABS_REP interface for OS.Process.status.

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

U   mlton/trunk/basis-library/mlton/exit.sml
U   mlton/trunk/basis-library/posix/process.sml
U   mlton/trunk/basis-library/system/pre-os.sml
U   mlton/trunk/basis-library/system/process.sml

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

Modified: mlton/trunk/basis-library/mlton/exit.sml
===================================================================
--- mlton/trunk/basis-library/mlton/exit.sml	2008-04-07 18:33:13 UTC (rev 6537)
+++ mlton/trunk/basis-library/mlton/exit.sml	2008-04-07 18:33:15 UTC (rev 6538)
@@ -10,8 +10,8 @@
       structure Status = 
          struct
             open PreOS.Process.Status
-            val fromInt = fromC o C_Status.fromInt
-            val toInt = C_Status.toInt o toC
+            val fromInt = fromRep o C_Status.fromInt
+            val toInt = C_Status.toInt o toRep
             val failure = fromInt 1
             val success = fromInt 0
          end
@@ -24,7 +24,7 @@
          else Cleaner.addNew (Cleaner.atExit, f)
 
       fun halt (status: Status.t) =
-         Primitive.MLton.halt (Status.toC status)
+         Primitive.MLton.halt (Status.toRep status)
 
       fun exit (status: Status.t): 'a =
          if !exiting

Modified: mlton/trunk/basis-library/posix/process.sml
===================================================================
--- mlton/trunk/basis-library/posix/process.sml	2008-04-07 18:33:13 UTC (rev 6537)
+++ mlton/trunk/basis-library/posix/process.sml	2008-04-07 18:33:15 UTC (rev 6538)
@@ -72,7 +72,7 @@
        | W_SIGNALED of signal
        | W_STOPPED of signal 
 
-      fun fromStatus' status = 
+      fun fromStatus' (status : C_Status.t) =
          if Prim.ifExited status <> C_Int.zero
             then (case Prim.exitStatus status of
                      0 => W_EXITED
@@ -83,7 +83,7 @@
             then W_STOPPED (Prim.stopSig status)
          else raise Fail "Posix.Process.fromStatus"
       fun fromStatus status =
-         fromStatus' (PreOS.Process.Status.toC status)
+         fromStatus' (PreOS.Process.Status.toRep status)
 
       structure W =
          struct

Modified: mlton/trunk/basis-library/system/pre-os.sml
===================================================================
--- mlton/trunk/basis-library/system/pre-os.sml	2008-04-07 18:33:13 UTC (rev 6537)
+++ mlton/trunk/basis-library/system/pre-os.sml	2008-04-07 18:33:15 UTC (rev 6538)
@@ -16,8 +16,6 @@
                   open Status
                   fun equals (s1,s2) =
                      (toRep s1) = (toRep s2)
-                  val fromC = fromRep
-                  val toC = toRep
                end
             type status = Status.t
          end

Modified: mlton/trunk/basis-library/system/process.sml
===================================================================
--- mlton/trunk/basis-library/system/process.sml	2008-04-07 18:33:13 UTC (rev 6537)
+++ mlton/trunk/basis-library/system/process.sml	2008-04-07 18:33:15 UTC (rev 6538)
@@ -27,7 +27,7 @@
                   case es of
                      W_EXITED => success
                    | W_EXITSTATUS w => 
-                        fromC (C_Status.castFromSysWord (Word8.castToSysWord w))
+                        fromRep (C_Status.castFromSysWord (Word8.castToSysWord w))
                    | W_SIGNALED _ => failure
                    | W_STOPPED _ => failure
                end
@@ -40,7 +40,7 @@
       fun isSuccess st = Status.equals (st, success)
 
       fun system cmd =
-         (Status.fromC o Posix.Error.SysCall.simpleResult)
+         (Status.fromRep o Posix.Error.SysCall.simpleResult)
          (fn () =>
           PrimitiveFFI.Posix.Process.system (NullString.nullTerm cmd))
 




More information about the MLton-commit mailing list