added cond_extern_table;
authorwenzelm
Mon, 28 Jun 1999 21:38:50 +0200
changeset 6845 598d2f32d452
parent 6844 3909657a7da6
child 6846 f2380295d4dd
added cond_extern_table;
src/Pure/General/name_space.ML
src/Pure/sign.ML
--- a/src/Pure/General/name_space.ML	Fri Jun 25 13:37:51 1999 +0200
+++ b/src/Pure/General/name_space.ML	Mon Jun 28 21:38:50 1999 +0200
@@ -26,6 +26,7 @@
   val extern: T -> string -> string
   val long_names: bool ref
   val cond_extern: T -> string -> string
+  val cond_extern_table: T -> 'a Symtab.table -> (string * 'a) list
   val dest: T -> (string * string list) list
 end;
 
@@ -103,6 +104,9 @@
 
 fun cond_extern space = if ! long_names then I else extern space;
 
+fun cond_extern_table space tab =
+  Library.sort_wrt #1 (map (apfst (cond_extern space)) (Symtab.dest tab));
+
 
 (* dest *)
 
--- a/src/Pure/sign.ML	Fri Jun 25 13:37:51 1999 +0200
+++ b/src/Pure/sign.ML	Mon Jun 28 21:38:50 1999 +0200
@@ -55,6 +55,7 @@
   val intern: sg -> string -> xstring -> string
   val extern: sg -> string -> string -> xstring
   val cond_extern: sg -> string -> string -> xstring
+  val cond_extern_table: sg -> string -> 'a Symtab.table -> (xstring * 'a) list
   val intern_class: sg -> xclass -> class
   val intern_tycon: sg -> xstring -> string
   val intern_const: sg -> xstring -> string
@@ -410,6 +411,7 @@
 fun intrn spaces kind = NameSpace.intern (space_of spaces kind);
 fun extrn spaces kind = NameSpace.extern (space_of spaces kind);
 fun cond_extrn spaces kind = NameSpace.cond_extern (space_of spaces kind);
+fun cond_extrn_table spaces kind tab = NameSpace.cond_extern_table (space_of spaces kind) tab;
 
 (*add names*)
 fun add_names spaces kind names =
@@ -471,6 +473,7 @@
   val intern = intrn o spaces_of;
   val extern = extrn o spaces_of;
   val cond_extern = cond_extrn o spaces_of;
+  fun cond_extern_table sg = cond_extrn_table (spaces_of sg);
 
   val intern_class = intrn_class o spaces_of;
   val intern_sort = intrn_sort o spaces_of;