src/Pure/context.ML
changeset 37871 c7ce7685e087
parent 37867 b9783e9e96e1
child 39020 ac0f24f850c9
--- a/src/Pure/context.ML	Wed Jul 21 15:23:46 2010 +0200
+++ b/src/Pure/context.ML	Wed Jul 21 15:31:38 2010 +0200
@@ -41,6 +41,7 @@
   val pretty_abbrev_thy: theory -> Pretty.T
   val str_of_thy: theory -> string
   val get_theory: theory -> string -> theory
+  val this_theory: theory -> string -> theory
   val deref: theory_ref -> theory
   val check_thy: theory -> theory_ref
   val eq_thy: theory * theory -> bool
@@ -253,6 +254,10 @@
   else if #stage (history_of thy) = finished then thy
   else error ("Unfinished theory " ^ quote name);
 
+fun this_theory thy name =
+  if theory_name thy = name then thy
+  else get_theory thy name;
+
 
 (* theory references *)