src/Pure/Thy/context.ML
author wenzelm
Tue, 02 Dec 1997 12:37:44 +0100
changeset 4338 68619c232262
child 4364 ab73573067d6
permissions -rw-r--r--
Global contexts: session and theory.

(*  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;