Mercurial > urweb
comparison demo/crud2.ur @ 823:669ac5e9a69e
Demo compiles with pattern-matching-fu
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 28 May 2009 10:35:25 -0400 |
parents | 1a317a707d71 |
children |
comparison
equal
deleted
inserted
replaced
822:d4e811beb8eb | 823:669ac5e9a69e |
---|---|
10 Ready = {Nam = "Ready", | 10 Ready = {Nam = "Ready", |
11 Show = (fn b => if b then | 11 Show = (fn b => if b then |
12 <xml>Ready!</xml> | 12 <xml>Ready!</xml> |
13 else | 13 else |
14 <xml>Not ready</xml>), | 14 <xml>Not ready</xml>), |
15 Widget = (fn (nm :: Name) => <xml> | 15 Widget = (fn [nm :: Name] => <xml> |
16 <select{nm}> | 16 <select{nm}> |
17 <option>Ready</option> | 17 <option>Ready</option> |
18 <option>Not ready</option> | 18 <option>Not ready</option> |
19 </select> | 19 </select> |
20 </xml>), | 20 </xml>), |
21 WidgetPopulated = (fn (nm :: Name) b => <xml> | 21 WidgetPopulated = (fn [nm :: Name] b => <xml> |
22 <select{nm}> | 22 <select{nm}> |
23 <option selected={b}>Ready</option> | 23 <option selected={b}>Ready</option> |
24 <option selected={not b}>Not ready</option> | 24 <option selected={not b}>Not ready</option> |
25 </select> | 25 </select> |
26 </xml>), | 26 </xml>), |