author | wenzelm |
Tue, 26 Oct 2021 16:01:05 +0200 | |
changeset 74593 | 66f10c877542 |
parent 73384 | d21dbfd3d69b |
child 75594 | 303f885d4a8c |
permissions | -rw-r--r-- |
67205 | 1 |
(* Title: Pure/ML/ml_init.ML |
62818 | 2 |
Author: Makarius |
3 |
||
67205 | 4 |
Initial ML environment. |
62818 | 5 |
*) |
6 |
||
7 |
val seconds = Time.fromReal; |
|
8 |
||
9 |
val _ = |
|
10 |
List.app ML_Name_Space.forget_val |
|
11 |
["isSome", "getOpt", "valOf", "foldl", "foldr", "print", "explode", "concat"]; |
|
12 |
||
13 |
val ord = SML90.ord; |
|
14 |
val chr = SML90.chr; |
|
15 |
val raw_explode = SML90.explode; |
|
63925 | 16 |
val implode = String.concat; |
62818 | 17 |
|
18 |
val pointer_eq = PolyML.pointerEq; |
|
19 |
||
20 |
val error_depth = PolyML.error_depth; |
|
21 |
||
22 |
open Thread; |
|
62923 | 23 |
|
24 |
datatype illegal = Interrupt; |
|
25 |
||
26 |
structure Basic_Exn: BASIC_EXN = Exn; |
|
27 |
open Basic_Exn; |
|
67206
b8f30228a55b
minor performance tuning, notably for Library.fold_string etc.;
wenzelm
parents:
67205
diff
changeset
|
28 |
|
b8f30228a55b
minor performance tuning, notably for Library.fold_string etc.;
wenzelm
parents:
67205
diff
changeset
|
29 |
structure String = |
b8f30228a55b
minor performance tuning, notably for Library.fold_string etc.;
wenzelm
parents:
67205
diff
changeset
|
30 |
struct |
b8f30228a55b
minor performance tuning, notably for Library.fold_string etc.;
wenzelm
parents:
67205
diff
changeset
|
31 |
open String; |
b8f30228a55b
minor performance tuning, notably for Library.fold_string etc.;
wenzelm
parents:
67205
diff
changeset
|
32 |
fun substring (s, i, n) = |
b8f30228a55b
minor performance tuning, notably for Library.fold_string etc.;
wenzelm
parents:
67205
diff
changeset
|
33 |
if n = 1 then String.str (String.sub (s, i)) |
b8f30228a55b
minor performance tuning, notably for Library.fold_string etc.;
wenzelm
parents:
67205
diff
changeset
|
34 |
else String.substring (s, i, n); |
b8f30228a55b
minor performance tuning, notably for Library.fold_string etc.;
wenzelm
parents:
67205
diff
changeset
|
35 |
end; |