[MLton-commit] r4848

Vesa Karvonen vesak at mlton.org
Mon Nov 20 11:37:15 PST 2006


Added Exn.
----------------------------------------------------------------------

U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/exn.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ext.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlkit/extensions.mlb
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/ext.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/extensions.mlb
U   mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/exn.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/export.sml

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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml	2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml	2006-11-20 19:36:40 UTC (rev 4848)
@@ -6,6 +6,7 @@
 
 (* Minimal modules for bootstrapping. *)
 
+structure Exn = struct type t = exn end
 structure Fn = struct type ('a, 'b) t = 'a -> 'b end
 structure Unit = struct type t = unit end
 structure Bool = struct open Bool type t = bool end

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/exn.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/exn.sml	2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/exn.sml	2006-11-20 19:36:40 UTC (rev 4848)
@@ -0,0 +1,11 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Exn : EXN = struct
+   open Exn Ext.Exn
+   val name = General.exnName
+   val message = General.exnMessage
+end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/exn.sml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ext.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ext.sml	2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ext.sml	2006-11-20 19:36:40 UTC (rev 4848)
@@ -0,0 +1,12 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Ext = struct
+   structure Exn = struct
+      fun addMessager _ = ()
+      fun history _ = []
+   end
+end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ext.sml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlkit/extensions.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlkit/extensions.mlb	2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlkit/extensions.mlb	2006-11-20 19:36:40 UTC (rev 4848)
@@ -0,0 +1,11 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+local
+   $(SML_LIB)/basis/basis.mlb
+in
+   ../ext.sml
+end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlkit/extensions.mlb
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/ext.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/ext.sml	2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/ext.sml	2006-11-20 19:36:40 UTC (rev 4848)
@@ -0,0 +1,16 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Ext = struct
+   structure Exn = struct
+      local
+         open MLton.Exn
+      in
+         val addMessager = addExnMessager
+         val history = history
+      end
+   end
+end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/ext.sml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/extensions.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/extensions.mlb	2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/extensions.mlb	2006-11-20 19:36:40 UTC (rev 4848)
@@ -0,0 +1,11 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+local
+   $(MLTON_ROOT)/basis/mlton.mlb
+in
+   ext.sml
+end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/extensions.mlb
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb	2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb	2006-11-20 19:36:40 UTC (rev 4848)
@@ -29,13 +29,21 @@
       "warnUnused true"
    in
       local
-         (* Workarounds (if any) *)
+         (* Workarounds (if any). *)
          detail/$(SML_COMPILER)/workarounds.mlb
 
          (* Minimal modules for bootstrapping. *)
          detail/bootstrap.sml
 
+         (* Compiler specific extensions (if any). *)
+         basis Ext = bas detail/$(SML_COMPILER)/extensions.mlb end
+
          basis Fn = bas public/fn.sig detail/fn.sml end
+         basis Exn = let
+            open Ext
+         in
+            bas public/exn.sig detail/exn.sml end
+         end
          basis Unit = bas public/unit.sig end
          basis Sq = bas public/sq.sig detail/sq.sml end
          basis UnOp = bas public/un-op.sig detail/un-op.sml end
@@ -167,7 +175,7 @@
 
          open BinOp BinPr Bool Buffer
          open Cmp
-         open Effect Emb Exit
+         open Effect Emb Exit Exn
          open Fix Fn
          open Iso
          open List

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/public/exn.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/exn.sig	2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/exn.sig	2006-11-20 19:36:40 UTC (rev 4848)
@@ -0,0 +1,36 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(** Utilities for dealing with exceptions. *)
+signature EXN = sig
+   type t = exn
+
+   val addMessager : (t -> String.t Option.t) Effect.t
+   (**
+    * Adds a pretty-printer to be used by {message} for converting
+    * exceptions to strings.  Messagers are tried in order from most
+    * recently added to least recently added.
+    *)
+
+   (** == Examining Exceptions == *)
+
+   val message : t -> String.t
+   (** Same as {General.exnMessage}. *)
+
+   val name : t -> String.t
+   (** Same as {General.exnName}. *)
+
+   val history : t -> String.t List.t
+   (**
+    * Returns call stack at the point that the exception was first raised.
+    * Each element of the list is a file position.  The elements are in
+    * reverse chronological order, i.e. the function called last is at the
+    * front of the list.
+    *
+    * {history} will likely return {[]} unless the program is compiled
+    * with a compiler dependent option to support exception history.
+    *)
+end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/public/exn.sig
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/export.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/export.sml	2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/export.sml	2006-11-20 19:36:40 UTC (rev 4848)
@@ -17,6 +17,7 @@
 signature EFFECT = EFFECT
 signature EMB = EMB
 signature EXIT = EXIT
+signature EXN = EXN
 signature FIX = FIX
 signature FN = FN
 signature INTEGER = INTEGER
@@ -67,6 +68,7 @@
 structure Effect : EFFECT = Effect
 structure Emb : EMB = Emb
 structure Exit : EXIT = Exit
+structure Exn : EXN = Exn
 structure Fix : FIX = Fix
 structure Fn : FN = Fn
 structure Int : INTEGER = Int




More information about the MLton-commit mailing list