src/Pure/basis.ML
changeset 5021 235f8508d440
parent 3244 71b760618f30
child 5208 cea0adbc7276
equal deleted inserted replaced
5020:e0f605038a9f 5021:235f8508d440
     1 (*  Title:      Pure/basis.ML
     1 (*  Title:      Pure/basis.ML
     2     ID:         $Id$
     2     ID:         $Id$
     3     Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     3     Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     4     Copyright   1993  University of Cambridge
     4     Copyright   1993  University of Cambridge
     5 
     5 
     6 Basis Library emulation.
     6 Basis Library emulation.  Needed for Poly/ML and Standard ML of New
     7 
     7 Jersey version 0.93 to 1.08.  Full compatibility cannot be obtained
     8 Needed for Poly/ML and Standard ML of New Jersey version 0.93 to 1.08.
     8 using a file: what about char constants?
     9 
       
    10 Full compatibility cannot be obtained using a file: what about char constants?
       
    11 *)
     9 *)
    12 
    10 
    13 exception Subscript;
    11 exception Subscript;
    14 
    12 
    15 structure Bool =
    13 structure Bool =
   142   val flushOut 	= flush_out
   140   val flushOut 	= flush_out
   143   end;
   141   end;
   144 
   142 
   145 
   143 
   146 fun print s = (output (std_out, s); flush_out std_out);
   144 fun print s = (output (std_out, s); flush_out std_out);
       
   145 
       
   146 
       
   147 structure General =
       
   148 struct
       
   149 
       
   150 local
       
   151   fun raised name = "exception " ^ name ^ " raised";
       
   152   fun raised_msg name msg = raised name ^ ": " ^ msg;
       
   153 in
       
   154   fun exnMessage Match = raised_msg "Match" "nonexhaustive match failure"
       
   155     | exnMessage Bind = raised_msg "Bind" "nonexhaustive binding failure"
       
   156     | exnMessage Interrupt = "Interrupt"
       
   157     | exnMessage (Io msg) = "I/O error: " ^ msg
       
   158     | exnMessage Neg = raised "Neg"
       
   159     | exnMessage Sum = raised "Sum"
       
   160     | exnMessage Diff = raised "Diff"
       
   161     | exnMessage Prod = raised "Prod"
       
   162     | exnMessage Quot = raised "Quot"
       
   163     | exnMessage Abs = raised "Abs"
       
   164     | exnMessage Div = raised "Div"
       
   165     | exnMessage Mod = raised "Mod"
       
   166     | exnMessage Floor = raised "Floor"
       
   167     | exnMessage Sqrt = raised "Sqrt"
       
   168     | exnMessage Exp = raised "Exp"
       
   169     | exnMessage Ln = raised "Ln"
       
   170     | exnMessage Ord = raised "Ord"
       
   171     | exnMessage Subscript = raised_msg "Subscript " "subscript out of bounds"
       
   172     | exnMessage Option.Option = raised "Option.Option"
       
   173     | exnMessage List.Empty = raised "List.Empty"
       
   174     | exnMessage (TextIO.Io {name, ...}) = raised_msg "TextIO.Io" name
       
   175     | exnMessage exn = raised "???";
       
   176 end;
       
   177 
       
   178 end;