From 50fc58e8fc815053950b7b919a75cb363d83f114 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 3 Sep 2011 12:51:05 -0400 Subject: An abstract type of IDs --- doc/manual.tex | 11 +++++++++++ include/urweb.h | 2 ++ lib/js/urweb.js | 9 +++++++++ lib/ur/basis.urs | 13 ++++++++----- src/c/urweb.c | 9 +++++++++ src/monoize.sml | 1 + src/settings.sml | 7 +++++-- tests/nextid.ur | 11 +++++++++++ 8 files changed, 56 insertions(+), 7 deletions(-) create mode 100644 tests/nextid.ur diff --git a/doc/manual.tex b/doc/manual.tex index a3800e17..e6a96c05 100644 --- a/doc/manual.tex +++ b/doc/manual.tex @@ -1983,6 +1983,17 @@ $$\begin{array}{l} \mt{val} \; \mt{onMouseup} : \mt{transaction} \; \mt{unit} \to \mt{transaction} \; \mt{unit} \end{array}$$ +\subsubsection{Node IDs} + +There is an abstract type of node IDs that may be assigned to \cd{id} attributes of most HTML tags. + +$$\begin{array}{l} + \mt{type} \; \mt{id} \\ + \mt{val} \; \mt{fresh} : \mt{transaction} \; \mt{id} +\end{array}$$ + +The \cd{fresh} function is allowed on both server and client, but there is no other way to create IDs, which includes lack of a way to force an ID to match a particular string. The only semantic importance of IDs within Ur/Web is in uses of the HTML \cd{