present multi_result;
authorwenzelm
Sun, 11 Nov 2001 21:38:54 +0100
changeset 12151 fb0fb0209c87
parent 12150 f83dc4202b78
child 12152 46f128d8133c
present multi_result;
src/Pure/Thy/html.ML
src/Pure/Thy/present.ML
--- a/src/Pure/Thy/html.ML	Sun Nov 11 21:38:25 2001 +0100
+++ b/src/Pure/Thy/html.ML	Sun Nov 11 21:38:54 2001 +0100
@@ -34,7 +34,7 @@
     (Url.T option * Url.T * bool option) list -> text -> text
   val end_theory: text
   val ml_file: Url.T -> string -> text
-  val result: string -> string -> thm -> text
+  val multi_result: string * (string * thm list) list -> text
   val results: string -> string -> thm list -> text
   val theorem: string -> thm -> text
   val theorems: string -> thm list -> text
@@ -277,10 +277,13 @@
 
 in
 
-fun result k a th = para (keyword k ^ thm_name a ^ "\n" ^ thm th);
 fun results k a ths = para (cat_lines ((keyword k ^ thm_name a) :: map thm ths));
 
-val theorem = result "theorem";
+fun multi_result (_, []) = ""
+  | multi_result (k, ((a, ths) :: res)) =
+      cat_lines (results k a ths :: map (uncurry (results "and")) res);
+
+fun theorem a th = multi_result ("theorem", [(a, [th])]);
 val theorems = results "theorems";
 
 end;
--- a/src/Pure/Thy/present.ML	Sun Nov 11 21:38:25 2001 +0100
+++ b/src/Pure/Thy/present.ML	Sun Nov 11 21:38:54 2001 +0100
@@ -25,7 +25,7 @@
   val old_symbol_source: string -> (unit -> Symbol.symbol list) -> unit
   val theory_output: string -> string -> unit
   val begin_theory: string -> string list -> (Path.T * bool) list -> theory -> theory
-  val result: string -> string -> thm -> unit
+  val multi_result: string * (string * thm list) list -> unit
   val results: string -> string -> thm list -> unit
   val theorem: string -> thm -> unit
   val theorems: string -> thm list -> unit
@@ -466,7 +466,7 @@
   end);
 
 
-fun result k a thm = with_session () (fn _ => with_context add_html (HTML.result k a thm));
+fun multi_result res = with_session () (fn _ => with_context add_html (HTML.multi_result res));
 fun results k a thms = with_session () (fn _ => with_context add_html (HTML.results k a thms));
 fun theorem a thm = with_session () (fn _ => with_context add_html (HTML.theorem a thm));
 fun theorems a thms = with_session () (fn _ => with_context add_html (HTML.theorems a thms));