added >> : (theory -> theory) -> unit;
authorwenzelm
Sun, 28 Dec 1997 14:56:09 +0100
changeset 4486 48e4fbc03b7c
parent 4485 697972696f71
child 4487 9b4c1db5aca1
added >> : (theory -> theory) -> unit;
src/Pure/Thy/context.ML
--- a/src/Pure/Thy/context.ML	Sun Dec 28 14:55:34 1997 +0100
+++ b/src/Pure/Thy/context.ML	Sun Dec 28 14:56:09 1997 +0100
@@ -5,7 +5,7 @@
 Global contexts: session and theory.
 *)
 
-signature CONTEXT =
+signature BASIC_CONTEXT =
 sig
   val get_session: unit -> string list
   val add_session: string -> unit
@@ -15,6 +15,12 @@
   val reset_context: unit -> unit
 end;
 
+signature CONTEXT =
+sig
+  include BASIC_CONTEXT
+  val >> : (theory -> theory) -> unit
+end;
+
 structure Context: CONTEXT =
 struct
 
@@ -41,6 +47,12 @@
 fun reset_context () = current_theory := None;
 
 
+nonfix >>;
+fun >> f = current_theory := Some (f (get_context ()));
+
+
 end;
 
-open Context;
+
+structure BasicContext: BASIC_CONTEXT = Context;
+open BasicContext;