src/Pure/ML/ml_print_depth0.ML
author nipkow
Tue, 28 Apr 2020 22:55:51 +0200
changeset 71811 fa4f8f3d69f2
parent 62900 c641bf9402fd
permissions -rw-r--r--
merged
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
62878
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
     1
(*  Title:      Pure/ML/ml_print_depth0.ML
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
     3
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
     4
Print depth for ML toplevel pp -- global default (unsynchronized).
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
     5
*)
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
     6
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
     7
signature ML_PRINT_DEPTH =
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
     8
sig
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
     9
  val set_print_depth: int -> unit
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
    10
  val get_print_depth: unit -> int
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
    11
end;
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
    12
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
    13
structure ML_Print_Depth: ML_PRINT_DEPTH =
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
    14
struct
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
    15
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
    16
val depth = Unsynchronized.ref 0;
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
    17
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
    18
fun set_print_depth n = (depth := n; PolyML.print_depth n);
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
    19
fun get_print_depth () = ! depth;
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
    20
1cec457e0a03 clarified modules -- simplified bootstrap;
wenzelm
parents:
diff changeset
    21
end;