summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-09-17 17:17:49 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-09-17 17:17:49 -0400
commitcdef77b52aeb37ea688bd93a37eb82132a1c99ef (patch)
tree09f6c9dbbd39edf98728c0143fa0e95be40d19ac /tests
parentba5ce199f90e1e5947195c4de8a69b7a312d59f1 (diff)
Don't try to check if functions are already tail-recursive
Diffstat (limited to 'tests')
-rw-r--r--tests/tail.ur11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/tail.ur b/tests/tail.ur
index 259b5f34..84e0b7e8 100644
--- a/tests/tail.ur
+++ b/tests/tail.ur
@@ -8,8 +8,17 @@ fun addEm n =
n2 <- addEm (n - 1);
return (n1 + n2)
+fun addEm' n acc =
+ if n = 0 then
+ return acc
+ else
+ n1 <- rpc (one ());
+ addEm' (n - 1) (n1 + acc)
+
fun main () =
s <- source 0;
- return <xml><body onload={n <- addEm 3; set s n}>
+ s' <- source 0;
+ return <xml><body onload={n <- addEm 3; set s n; n <- addEm' 4 0; set s' n; alert "Welcome!"}>
<dyn signal={n <- signal s; return (txt n)}/>
+ <dyn signal={n <- signal s'; return (txt n)}/>
</body></xml>