Mercurial > urweb
comparison tests/nextid.ur @ 1556:e1f5d9c4cc20
An abstract type of IDs
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sat, 03 Sep 2011 12:51:05 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1555:d5c961c709f9 | 1556:e1f5d9c4cc20 |
---|---|
1 fun main () : transaction page = | |
2 id1 <- fresh; | |
3 id2 <- fresh; | |
4 id3 <- fresh; | |
5 idS <- source id3; | |
6 return <xml><body> | |
7 <span id={id1}>Hi</span> <span id={id2}>there!</span><br/><br/> | |
8 <dyn signal={idS <- signal idS; return <xml><span id={idS}>Whoa-hoa!</span></xml>}/> | |
9 <button onclick={id <- fresh; set idS id}/> | |
10 Source: <dyn signal={idS <- signal idS; return (txt (<xml><span id={idS}>Whoa-hoa!</span></xml> : xbody))}/> | |
11 </body></xml> |