Basis library emulation for old ML compilers
authorpaulson
Fri, 22 Nov 1996 17:38:27 +0100
changeset 2217 411f4683feb6
parent 2216 9b080867c7b1
child 2218 36bb751913c6
Basis library emulation for old ML compilers
src/Pure/basis.ML
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Pure/basis.ML	Fri Nov 22 17:38:27 1996 +0100
@@ -0,0 +1,37 @@
+(*  Title:      Pure/NJ
+    ID:         $Id$
+    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
+    Copyright   1993  University of Cambridge
+
+Basis Library emulation
+
+Needed for Poly/ML and Standard ML of New Jersey version 0.93
+
+Full compatibility cannot be obtained using a file: what about char constants?
+*)
+
+structure Int =
+  struct
+  fun max (x, y) = if x < y then y else x : int;
+  fun min (x, y) = if x < y then x else y : int;
+  end;
+
+structure TextIO =
+  struct
+  type instream = instream
+  and  outstream = outstream
+  exception Io of {name: string, function: string, cause: exn}
+  val stdIn 	= std_in
+  val stdOut 	= std_out
+  val openIn 	= open_in
+  val openAppend = open_append
+  val openOut 	= open_out
+  val closeIn 	= close_in
+  val closeOut 	= close_out
+  val inputN 	= input
+  val inputAll  = fn is => inputN (is, 999999)
+  val inputLine = input_line
+  val endOfStream = end_of_stream
+  val output 	= output
+  val flushOut 	= flush_out
+  end;