clarified signature: more operations;
authorwenzelm
Sat, 08 Jun 2024 11:47:48 +0200
changeset 80298 f3bfec3b02f0
parent 80297 f38771b2df1c
child 80299 a397fd0c451a
clarified signature: more operations;
src/Pure/General/name_space.ML
src/Pure/Isar/locale.ML
--- a/src/Pure/General/name_space.ML	Sat Jun 08 11:32:38 2024 +0200
+++ b/src/Pure/General/name_space.ML	Sat Jun 08 11:47:48 2024 +0200
@@ -28,6 +28,7 @@
   val names_long: bool Config.T
   val names_short: bool Config.T
   val names_unique: bool Config.T
+  val extern_generic: Context.generic -> T -> string -> xstring
   val extern: Proof.context -> T -> string -> xstring
   val extern_ord: Proof.context -> T -> string ord
   val extern_shortest: Proof.context -> T -> string -> xstring
@@ -291,11 +292,11 @@
 val names_short = Config.declare_option_bool ("names_short", \<^here>);
 val names_unique = Config.declare_option_bool ("names_unique", \<^here>);
 
-fun extern ctxt space name =
+fun extern_generic context space name =
   let
-    val names_long = Config.get ctxt names_long;
-    val names_short = Config.get ctxt names_short;
-    val names_unique = Config.get ctxt names_unique;
+    val names_long = Config.get_generic context names_long;
+    val names_short = Config.get_generic context names_short;
+    val names_unique = Config.get_generic context names_unique;
 
     fun extern_chunks require_unique a chunks =
       let val {full_name = c, unique, ...} = intern_chunks space chunks in
@@ -321,6 +322,8 @@
     else extern_names (get_aliases space name)
   end;
 
+val extern = extern_generic o Context.Proof;
+
 fun extern_ord ctxt space = string_ord o apply2 (extern ctxt space);
 
 fun extern_shortest ctxt =
--- a/src/Pure/Isar/locale.ML	Sat Jun 08 11:32:38 2024 +0200
+++ b/src/Pure/Isar/locale.ML	Sat Jun 08 11:47:48 2024 +0200
@@ -199,7 +199,8 @@
    (Args.theory -- Scan.lift Parse.embedded_position >>
       (ML_Syntax.print_string o uncurry check)));
 
-fun extern thy = Name_Space.extern (Proof_Context.init_global thy) (locale_space thy);
+fun extern thy =
+  Name_Space.extern_generic (Context.Theory thy) (locale_space thy);
 
 fun markup_extern ctxt =
   Name_Space.markup_extern ctxt (locale_space (Proof_Context.theory_of ctxt));