Global contexts: session and theory.
authorwenzelm
Tue, 02 Dec 1997 12:37:44 +0100
changeset 4338 68619c232262
parent 4337 062cdcb04b08
child 4339 b75312b2676d
Global contexts: session and theory.
src/Pure/Thy/context.ML
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Pure/Thy/context.ML	Tue Dec 02 12:37:44 1997 +0100
@@ -0,0 +1,40 @@
+(*  Title:      Pure/Thy/context.ML
+    ID:         $Id$
+    Author:     Markus Wenzel, TU Muenchen
+
+Global contexts: session and theory.
+*)
+
+signature CONTEXT =
+sig
+  val get_session: unit -> string list
+  val add_session: string -> unit
+  val reset_session: unit -> unit
+  val get_context: unit -> theory
+  val context: theory -> unit
+end;
+
+structure Context: CONTEXT =
+struct
+
+
+(* session *)
+
+val current_session = ref ([]: string list);
+
+fun get_session () = ! current_session;
+fun add_session s = current_session := ! current_session @ [s];
+fun reset_session () = current_session := [];
+
+
+(* theory context *)
+
+val current_theory = ref ProtoPure.thy;
+
+fun context thy = current_theory := thy;
+fun get_context () = ! current_theory;
+
+
+end;
+
+open Context;