aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/js
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-09-03 12:51:05 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-09-03 12:51:05 -0400
commitcd28ea2ee01ac023b7b1dfac39ae5ddf4ded5c4e (patch)
treed792d445b5fbc6b0a16eadef95d70510f9037dd6 /lib/js
parent3c860c3c95d4d085499fd01e3140f32aafbc1bd7 (diff)
An abstract type of IDs
Diffstat (limited to 'lib/js')
-rw-r--r--lib/js/urweb.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 1277175d..7f636ef9 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -1374,5 +1374,14 @@ function bless(s) {
return u;
}
+
+// ID generation
+
+var nextId = 0;
+
+function fresh() {
+ return (--nextId).toString();
+}
+
// App-specific code