comparison tests/rs.ur @ 1446:36f7d1debb37

Each context gets its own non-repeating sequence of source numbers
author Adam Chlipala <adam@chlipala.net>
date Sat, 09 Apr 2011 14:36:47 -0400
parents
children
comparison
equal deleted inserted replaced
1445:6e6f1643c4e9 1446:36f7d1debb37
1 fun bobo () =
2 n1 <- source 0;
3 n2 <- source 1;
4 return <xml>
5 <dyn signal={n1 <- signal n1; n2 <- signal n2; return <xml>{[n1 + n2]}</xml>}/>
6 <button value="Increment1" onclick={v <- get n1; set n1 (v + 1)}/>
7 <button value="Increment2" onclick={v <- get n2; set n2 (v + 1)}/>
8 </xml>
9
10 fun main () =
11 x <- source <xml/>;
12 return <xml><body>
13 <dyn signal={signal x}/>
14 <button value="Grab" onclick={y <- rpc (bobo ()); set x y}/>
15 </body></xml>