diff tests/active.ur @ 1786:d794149b3713

<active>
author Adam Chlipala <adam@chlipala.net>
date Sat, 21 Jul 2012 13:55:35 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/active.ur	Sat Jul 21 13:55:35 2012 -0400
@@ -0,0 +1,14 @@
+fun counter' () =
+    s <- source 0;
+    return <xml>
+      <dyn signal={n <- signal s; return (txt n)}/>
+      <button onclick={fn _ => n <- get s; set s (n + 1)}/>
+    </xml>
+
+fun counter () = <xml><active code={counter' ()}/></xml>
+
+fun main () : transaction page = return <xml><body>
+  {counter ()}
+  <hr/>
+  {counter ()}
+</body></xml>