added generic_theory transaction;
authorwenzelm
Sat, 29 Mar 2008 19:14:13 +0100
changeset 26491 c93ff30790fe
parent 26490 87d27e426f14
child 26492 6e87cc839632
added generic_theory transaction;
src/Pure/Isar/toplevel.ML
--- a/src/Pure/Isar/toplevel.ML	Sat Mar 29 19:14:12 2008 +0100
+++ b/src/Pure/Isar/toplevel.ML	Sat Mar 29 19:14:13 2008 +0100
@@ -68,6 +68,7 @@
   val keep': (bool -> state -> unit) -> transition -> transition
   val imperative: (unit -> unit) -> transition -> transition
   val theory: (theory -> theory) -> transition -> transition
+  val generic_theory: (generic_theory -> generic_theory) -> transition -> transition
   val theory': (bool -> theory -> theory) -> transition -> transition
   val begin_local_theory: bool -> (theory -> local_theory) -> transition -> transition
   val end_local_theory: transition -> transition
@@ -524,6 +525,10 @@
 
 (* theory transitions *)
 
+fun generic_theory f = app_current (fn _ =>
+  (fn Theory (gthy, _) => Theory (f gthy, NONE)
+    | _ => raise UNDEF));
+
 fun theory' f = app_current (fn int =>
   (fn Theory (Context.Theory thy, _) => Theory (Context.Theory (f int thy), NONE)
     | _ => raise UNDEF));