comparison demo/tree.ur @ 732:5819fb63c93a

Effectness analysis
author Adam Chlipala <adamc@hcoop.net>
date Thu, 16 Apr 2009 15:29:39 -0400
parents 1db127b245ed
children b9321bcefb42
comparison
equal deleted inserted replaced
731:e0dd85ea58e1 732:5819fb63c93a
6 open TreeFun.Make(struct 6 open TreeFun.Make(struct
7 val tab = t 7 val tab = t
8 end) 8 end)
9 9
10 fun row r = <xml> 10 fun row r = <xml>
11 #{[r.Id]}: {[r.Nam]} <a link={del r.Id}>[Delete]</a> 11 #{[r.Id]}: {[r.Nam]} <form><submit action={del r.Id} value="Delete"/></form>
12 12
13 <form> 13 <form>
14 Add child: <textbox{#Nam}/> <submit action={add (Some r.Id)}/> 14 Add child: <textbox{#Nam}/> <submit action={add (Some r.Id)}/>
15 </form> 15 </form>
16 </xml> 16 </xml>
28 and add parent r = 28 and add parent r =
29 id <- nextval s; 29 id <- nextval s;
30 dml (INSERT INTO t (Id, Parent, Nam) VALUES ({[id]}, {[parent]}, {[r.Nam]})); 30 dml (INSERT INTO t (Id, Parent, Nam) VALUES ({[id]}, {[parent]}, {[r.Nam]}));
31 main () 31 main ()
32 32
33 and del id = 33 and del id () =
34 dml (DELETE FROM t WHERE Id = {[id]}); 34 dml (DELETE FROM t WHERE Id = {[id]});
35 main () 35 main ()