src/Pure/basis.ML
author paulson
Tue, 26 Nov 1996 16:29:30 +0100
changeset 2230 275a5a699ff7
parent 2217 411f4683feb6
child 2265 3123fef88dce
permissions -rw-r--r--
Structure Bool and value Int.toString needed to replace makestring calls
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2217
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
     1
(*  Title:      Pure/NJ
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
     2
    ID:         $Id$
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
     4
    Copyright   1993  University of Cambridge
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
     5
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
     6
Basis Library emulation
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
     7
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
     8
Needed for Poly/ML and Standard ML of New Jersey version 0.93
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
     9
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    10
Full compatibility cannot be obtained using a file: what about char constants?
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    11
*)
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    12
2230
275a5a699ff7 Structure Bool and value Int.toString needed to replace makestring calls
paulson
parents: 2217
diff changeset
    13
structure Bool =
275a5a699ff7 Structure Bool and value Int.toString needed to replace makestring calls
paulson
parents: 2217
diff changeset
    14
  struct
275a5a699ff7 Structure Bool and value Int.toString needed to replace makestring calls
paulson
parents: 2217
diff changeset
    15
  fun toString true  = "true"
275a5a699ff7 Structure Bool and value Int.toString needed to replace makestring calls
paulson
parents: 2217
diff changeset
    16
    | toString false = "false"
275a5a699ff7 Structure Bool and value Int.toString needed to replace makestring calls
paulson
parents: 2217
diff changeset
    17
  end;
275a5a699ff7 Structure Bool and value Int.toString needed to replace makestring calls
paulson
parents: 2217
diff changeset
    18
2217
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    19
structure Int =
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    20
  struct
2230
275a5a699ff7 Structure Bool and value Int.toString needed to replace makestring calls
paulson
parents: 2217
diff changeset
    21
  fun toString (i: int) = makestring i;
2217
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    22
  fun max (x, y) = if x < y then y else x : int;
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    23
  fun min (x, y) = if x < y then x else y : int;
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    24
  end;
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    25
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    26
structure TextIO =
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    27
  struct
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    28
  type instream = instream
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    29
  and  outstream = outstream
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    30
  exception Io of {name: string, function: string, cause: exn}
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    31
  val stdIn 	= std_in
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    32
  val stdOut 	= std_out
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    33
  val openIn 	= open_in
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    34
  val openAppend = open_append
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    35
  val openOut 	= open_out
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    36
  val closeIn 	= close_in
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    37
  val closeOut 	= close_out
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    38
  val inputN 	= input
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    39
  val inputAll  = fn is => inputN (is, 999999)
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    40
  val inputLine = input_line
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    41
  val endOfStream = end_of_stream
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    42
  val output 	= output
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    43
  val flushOut 	= flush_out
411f4683feb6 Basis library emulation for old ML compilers
paulson
parents:
diff changeset
    44
  end;