tuned -- avoid spurious exception trace for "the";
authorwenzelm
Wed, 25 Apr 2018 14:13:44 +0200
changeset 68036 4c9e79aeadf0
parent 68032 412fe0623c5d
child 68037 7eb532e4f8c0
tuned -- avoid spurious exception trace for "the";
src/Pure/more_thm.ML
--- a/src/Pure/more_thm.ML	Tue Apr 24 22:22:25 2018 +0100
+++ b/src/Pure/more_thm.ML	Wed Apr 25 14:13:44 2018 +0200
@@ -603,10 +603,9 @@
 
 (* unofficial theorem names *)
 
+fun has_name_hint thm = AList.defined (op =) (Thm.get_tags thm) Markup.nameN;
 fun the_name_hint thm = the (AList.lookup (op =) (Thm.get_tags thm) Markup.nameN);
-
-val has_name_hint = can the_name_hint;
-val get_name_hint = the_default "??.unknown" o try the_name_hint;
+fun get_name_hint thm = if has_name_hint thm then the_name_hint thm else "??.unknown";
 
 fun put_name_hint name = untag_rule Markup.nameN #> tag_rule (Markup.nameN, name);