[MLton-commit] r6824

Matthew Fluet fluet at mlton.org
Mon Sep 1 06:19:32 PDT 2008


Consistency with mlton/exit.sml.

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

U   mlton/trunk/basis-library/mlton/exn.sml

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

Modified: mlton/trunk/basis-library/mlton/exn.sml
===================================================================
--- mlton/trunk/basis-library/mlton/exn.sml	2008-09-01 13:19:28 UTC (rev 6823)
+++ mlton/trunk/basis-library/mlton/exn.sml	2008-09-01 13:19:31 UTC (rev 6824)
@@ -49,20 +49,19 @@
             handle _ => (message "Top-level handler raised exception.\n"
                          ; Exit.halt Exit.Status.failure
                          ; raise Fail "MLton.Exn.wrapHandler")
+         val defaultHandler = fn exn =>
+            (message (concat ["unhandled exception: ", exnMessage exn, "\n"])
+             ; (case history exn of
+                   [] => ()
+                 | l =>
+                      (message "with history:\n"
+                       ; List.app (fn s => message (concat ["\t", s, "\n"])) l))
+             ; Exit.exit Exit.Status.failure)
       in
          val getTopLevelHandler = Primitive.TopLevel.getHandler
          val setTopLevelHandler = Primitive.TopLevel.setHandler o wrapHandler
          fun 'a defaultTopLevelHandler (exn: exn): 'a =
-            wrapHandler
-            (fn exn =>
-             (message (concat ["unhandled exception: ", exnMessage exn, "\n"])
-              ; (case history exn of
-                    [] => ()
-                  | l =>
-                       (message "with history:\n"
-                        ; List.app (fn s => message (concat ["\t", s, "\n"])) l))
-              ; Exit.exit Exit.Status.failure))
-            exn
+            wrapHandler defaultHandler exn
          fun 'a topLevelHandler (exn: exn) : 'a =
             (getTopLevelHandler () exn
              ; raise Fail "MLton.Exn.topLevelHandler")




More information about the MLton-commit mailing list