more examples;
authorwenzelm
Sat, 16 Oct 2010 20:27:35 +0100
changeset 39857 ea93e088398d
parent 39856 84e1f8d8f30a
child 39858 5be7a57c3b4e
more examples;
doc-src/IsarImplementation/Thy/Prelim.thy
--- a/doc-src/IsarImplementation/Thy/Prelim.thy	Sat Oct 16 20:02:11 2010 +0100
+++ b/doc-src/IsarImplementation/Thy/Prelim.thy	Sat Oct 16 20:27:35 2010 +0100
@@ -781,6 +781,28 @@
   \end{description}
 *}
 
+text %mlex {* The following simple examples demonstrate how to produce
+  fresh names from the initial @{ML Name.context}. *}
+
+ML {*
+  Name.invents Name.context "a" 5;
+  #1 (Name.variants ["x", "x", "a", "a", "'a", "'a"] Name.context);
+*}
+
+text {* \medskip The same works reletively to the formal context as
+follows. *}
+
+locale ex = fixes a b c :: 'a
+begin
+
+ML {*
+  val names = Variable.names_of @{context};
+  Name.invents names "a" 5;
+  #1 (Name.variants ["x", "x", "a", "a", "'a", "'a"] names);
+*}
+
+end
+
 
 subsection {* Indexed names \label{sec:indexname} *}