avoid odd Named_Target.reinit altogether
authorhaftmann
Sat, 07 Jun 2014 08:16:03 +0200
changeset 57184 56f3351cc492
parent 57183 766e7f50c22f
child 57185 188da8aaae24
avoid odd Named_Target.reinit altogether
src/Pure/Isar/named_target.ML
src/Pure/Isar/toplevel.ML
--- a/src/Pure/Isar/named_target.ML	Sat Jun 07 08:16:03 2014 +0200
+++ b/src/Pure/Isar/named_target.ML	Sat Jun 07 08:16:03 2014 +0200
@@ -12,7 +12,6 @@
   val class_of: local_theory -> string option
   val init: string -> theory -> local_theory
   val theory_init: theory -> local_theory
-  val reinit: local_theory -> local_theory -> local_theory
   val context_cmd: xstring * Position.T -> theory -> local_theory
 end;
 
@@ -171,10 +170,6 @@
 
 val theory_init = init "";
 
-val reinit =
-  Local_Theory.assert_bottom true #> Data.get #> the #>
-  (fn Target {target, ...} => Local_Theory.exit_global #> init target);
-
 fun context_cmd ("-", _) thy = theory_init thy
   | context_cmd target thy = init (Locale.check thy target) thy;
 
--- a/src/Pure/Isar/toplevel.ML	Sat Jun 07 08:16:03 2014 +0200
+++ b/src/Pure/Isar/toplevel.ML	Sat Jun 07 08:16:03 2014 +0200
@@ -115,8 +115,8 @@
   | named_begin NONE (Context.Proof lthy) =
       (Context.Proof o Local_Theory.restore, lthy)
   | named_begin (SOME loc) (Context.Proof lthy) =
-      (Context.Proof o Named_Target.reinit lthy,
-        named_init loc (named_exit (Local_Theory.assert_nonbrittle lthy)));
+      (Context.Proof o Named_Target.init (the (Named_Target.locale_of lthy)) o named_exit,
+        (named_init loc o named_exit o Local_Theory.assert_nonbrittle) lthy);
 
 
 (* datatype node *)