diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-09-03 12:51:05 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-09-03 12:51:05 -0400 |
commit | 50fc58e8fc815053950b7b919a75cb363d83f114 (patch) | |
tree | d792d445b5fbc6b0a16eadef95d70510f9037dd6 /tests | |
parent | 22dca5aaa24df32b6b59b27b62944d28adcad9ca (diff) |
An abstract type of IDs
Diffstat (limited to 'tests')
-rw-r--r-- | tests/nextid.ur | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/nextid.ur b/tests/nextid.ur new file mode 100644 index 00000000..8120ef0b --- /dev/null +++ b/tests/nextid.ur @@ -0,0 +1,11 @@ +fun main () : transaction page = + id1 <- fresh; + id2 <- fresh; + id3 <- fresh; + idS <- source id3; + return <xml><body> + <span id={id1}>Hi</span> <span id={id2}>there!</span><br/><br/> + <dyn signal={idS <- signal idS; return <xml><span id={idS}>Whoa-hoa!</span></xml>}/> + <button onclick={id <- fresh; set idS id}/> + Source: <dyn signal={idS <- signal idS; return (txt (<xml><span id={idS}>Whoa-hoa!</span></xml> : xbody))}/> + </body></xml> |