summaryrefslogtreecommitdiff
path: root/tests/tail.ur
blob: 259b5f346849a1f89e1abe2047df300ec02773f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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>