tuned the section about printing several bits of inormation
authorChristian Urban <urbanc@in.tum.de>
Wed, 05 Aug 2009 16:00:01 +0200
changeset 306 fe732e890d87
parent 305 2ac9dc1a95b4
child 307 f4fa6540e280
tuned the section about printing several bits of inormation
IsaMakefile
ProgTutorial/FirstSteps.thy
ProgTutorial/Intro.thy
progtutorial.pdf
--- a/IsaMakefile	Wed Aug 05 09:24:18 2009 +0200
+++ b/IsaMakefile	Wed Aug 05 16:00:01 2009 +0200
@@ -23,6 +23,7 @@
           ProgTutorial/Package/*.ML
 	@rm -rf ProgTutorial/generated/* 
 	$(USEDIR) HOL ProgTutorial
+	hg parent --template '{date|shortdate}' > ProgTutorial/generated/tip
 	$(ISATOOL) version > ProgTutorial/generated/version 
 	$(ML_HOME)/poly -v > ProgTutorial/generated/pversion
 	$(ISATOOL) document -o pdf  ProgTutorial/generated
--- a/ProgTutorial/FirstSteps.thy	Wed Aug 05 09:24:18 2009 +0200
+++ b/ProgTutorial/FirstSteps.thy	Wed Aug 05 16:00:01 2009 +0200
@@ -147,7 +147,9 @@
   fun strip ("\^A" :: _ :: cs) = strip cs
     | strip (c :: cs) = c :: strip cs
     | strip [] = [];
-in implode o strip o explode end;
+in 
+  implode o strip o explode 
+end
 
 fun redirect_tracing stream =
  Output.tracing_fn := (fn s =>
@@ -268,14 +270,34 @@
   commas (map (string_of_thm_no_vars ctxt) thms) *}
 
 text {*
-  When printing out several `parcels' of information that belong 
-  together you should try to keep this information together. For 
-  this you can use the function @{ML [index] cat_lines}, which 
+  When printing out several parcels of information that semantiaclly 
+  belong  together, like a warning message consisting of a term and
+  a type, you should try to keep this information together 
+  in a single string. So do not print out information as
+
+@{ML_response_fake [display,gray]
+"tracing \"First half,\"; 
+tracing \"and second half.\""
+"First half,
+and second half."}
+
+  but as a single string with appropriate formatting. For example
+
+@{ML_response_fake [display,gray]
+"tracing (\"First half,\" ^ \"\\n\" ^ \"and second half.\")"
+"First half,
+and second half."}
+  
+  To ease this kind of string manipulations, there are a number
+  of library functions. For example,  the function @{ML [index] cat_lines}
   concatenates a list of strings and inserts newlines. 
 
   @{ML_response [display, gray]
   "cat_lines [\"foo\", \"bar\"]"
   "\"foo\\nbar\""}
+
+  Section \ref{sec:pretty} will also explain infrastructure that helps 
+  with more elaborate pretty printing. 
 *}
 
 
--- a/ProgTutorial/Intro.thy	Wed Aug 05 09:24:18 2009 +0200
+++ b/ProgTutorial/Intro.thy	Wed Aug 05 16:00:01 2009 +0200
@@ -233,7 +233,8 @@
   with TBD.}
 
   \vfill
-  This document was compiled with:\\
+  
+  This document (version \input{tip}\hspace{-0.5ex}) was compiled with:\\
   \input{version}\\
   \input{pversion}
 *}
Binary file progtutorial.pdf has changed