Global contexts: session and theory.
--- /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;