comparison tests/jsinj.ur @ 593:f277f5faebcd

Injected a record
author Adam Chlipala <adamc@hcoop.net>
date Fri, 02 Jan 2009 12:42:39 -0500
parents a8be5a2068a5
children 55829473f6a7
comparison
equal deleted inserted replaced
592:a8be5a2068a5 593:f277f5faebcd
5 5
6 cookie int : int 6 cookie int : int
7 cookie float : float 7 cookie float : float
8 cookie string : string 8 cookie string : string
9 cookie bool : bool 9 cookie bool : bool
10 cookie pair : int * float
10 11
11 fun main () : transaction page = 12 fun main () : transaction page =
12 n <- getCookie int; 13 n <- getCookie int;
13 n <- return (getOpt n 7); 14 n <- return (getOpt n 7);
14 sn <- source 6; 15 sn <- source 6;
23 24
24 b <- getCookie bool; 25 b <- getCookie bool;
25 b <- return (getOpt b True); 26 b <- return (getOpt b True);
26 sb <- source False; 27 sb <- source False;
27 28
29 p <- getCookie pair;
30 p <- return (getOpt p (1, 2.3));
31 sp <- source (4, 5.6);
32
28 return <xml><body> 33 return <xml><body>
29 <dyn signal={n <- signal sn; return <xml>{[n]}</xml>}/> 34 <dyn signal={n <- signal sn; return <xml>{[n]}</xml>}/>
30 <a onclick={set sn n}>CHANGE</a><br/> 35 <a onclick={set sn n}>CHANGE</a><br/>
31 36
32 <dyn signal={f <- signal sf; return <xml>{[f]}</xml>}/> 37 <dyn signal={f <- signal sf; return <xml>{[f]}</xml>}/>
35 <dyn signal={s <- signal ss; return <xml>{[s]}</xml>}/> 40 <dyn signal={s <- signal ss; return <xml>{[s]}</xml>}/>
36 <a onclick={set ss s}>CHANGE</a><br/> 41 <a onclick={set ss s}>CHANGE</a><br/>
37 42
38 <dyn signal={b <- signal sb; return <xml>{[b]}</xml>}/> 43 <dyn signal={b <- signal sb; return <xml>{[b]}</xml>}/>
39 <a onclick={set sb b}>CHANGE</a><br/> 44 <a onclick={set sb b}>CHANGE</a><br/>
45
46 <dyn signal={p <- signal sp; return <xml>{[p.1]}, {[p.2]}</xml>}/>
47 <a onclick={set sp p}>CHANGE</a><br/>
40 </body></xml> 48 </body></xml>