summaryrefslogtreecommitdiff
path: root/tests/tail.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-09-17 16:35:11 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-09-17 16:35:11 -0400
commitae83d3e44959b43c167ba83736055bf94ace3113 (patch)
tree9d7a2e3bc1dff89e7399d555415ffae5c45c8b52 /tests/tail.ur
parentbf1a78ce9a5d60f8f4c40d0087f6caf90c10a796 (diff)
Basic tail recursion introduction seems to be working
Diffstat (limited to 'tests/tail.ur')
-rw-r--r--tests/tail.ur15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/tail.ur b/tests/tail.ur
new file mode 100644
index 00000000..259b5f34
--- /dev/null
+++ b/tests/tail.ur
@@ -0,0 +1,15 @@
+fun one () = return 1
+
+fun addEm n =
+ if n = 0 then
+ return 0
+ else
+ n1 <- rpc (one ());
+ n2 <- addEm (n - 1);
+ return (n1 + n2)
+
+fun main () =
+ s <- source 0;
+ return <xml><body onload={n <- addEm 3; set s n}>
+ <dyn signal={n <- signal s; return (txt n)}/>
+ </body></xml>