src/Pure/basis.ML
changeset 5021 235f8508d440
parent 3244 71b760618f30
child 5208 cea0adbc7276
     1.1 --- a/src/Pure/basis.ML	Wed Jun 10 11:56:23 1998 +0200
     1.2 +++ b/src/Pure/basis.ML	Wed Jun 10 11:57:01 1998 +0200
     1.3 @@ -3,11 +3,9 @@
     1.4      Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     1.5      Copyright   1993  University of Cambridge
     1.6  
     1.7 -Basis Library emulation.
     1.8 -
     1.9 -Needed for Poly/ML and Standard ML of New Jersey version 0.93 to 1.08.
    1.10 -
    1.11 -Full compatibility cannot be obtained using a file: what about char constants?
    1.12 +Basis Library emulation.  Needed for Poly/ML and Standard ML of New
    1.13 +Jersey version 0.93 to 1.08.  Full compatibility cannot be obtained
    1.14 +using a file: what about char constants?
    1.15  *)
    1.16  
    1.17  exception Subscript;
    1.18 @@ -144,3 +142,37 @@
    1.19  
    1.20  
    1.21  fun print s = (output (std_out, s); flush_out std_out);
    1.22 +
    1.23 +
    1.24 +structure General =
    1.25 +struct
    1.26 +
    1.27 +local
    1.28 +  fun raised name = "exception " ^ name ^ " raised";
    1.29 +  fun raised_msg name msg = raised name ^ ": " ^ msg;
    1.30 +in
    1.31 +  fun exnMessage Match = raised_msg "Match" "nonexhaustive match failure"
    1.32 +    | exnMessage Bind = raised_msg "Bind" "nonexhaustive binding failure"
    1.33 +    | exnMessage Interrupt = "Interrupt"
    1.34 +    | exnMessage (Io msg) = "I/O error: " ^ msg
    1.35 +    | exnMessage Neg = raised "Neg"
    1.36 +    | exnMessage Sum = raised "Sum"
    1.37 +    | exnMessage Diff = raised "Diff"
    1.38 +    | exnMessage Prod = raised "Prod"
    1.39 +    | exnMessage Quot = raised "Quot"
    1.40 +    | exnMessage Abs = raised "Abs"
    1.41 +    | exnMessage Div = raised "Div"
    1.42 +    | exnMessage Mod = raised "Mod"
    1.43 +    | exnMessage Floor = raised "Floor"
    1.44 +    | exnMessage Sqrt = raised "Sqrt"
    1.45 +    | exnMessage Exp = raised "Exp"
    1.46 +    | exnMessage Ln = raised "Ln"
    1.47 +    | exnMessage Ord = raised "Ord"
    1.48 +    | exnMessage Subscript = raised_msg "Subscript " "subscript out of bounds"
    1.49 +    | exnMessage Option.Option = raised "Option.Option"
    1.50 +    | exnMessage List.Empty = raised "List.Empty"
    1.51 +    | exnMessage (TextIO.Io {name, ...}) = raised_msg "TextIO.Io" name
    1.52 +    | exnMessage exn = raised "???";
    1.53 +end;
    1.54 +
    1.55 +end;