diff tests/gform.lac @ 147:eb16f2aadbe9

Meta-programming forms
author Adam Chlipala <adamc@hcoop.net>
date Tue, 22 Jul 2008 18:46:04 -0400
parents 80ac94b54e41
children 15e8b9775539
line wrap: on
line diff
--- a/tests/gform.lac	Tue Jul 22 18:20:13 2008 -0400
+++ b/tests/gform.lac	Tue Jul 22 18:46:04 2008 -0400
@@ -19,12 +19,21 @@
         </body></html>
 
         val page = fn () => <html><body>
+                <lform>
+                        {fold [fn rs :: {Unit} => xml lform [] (stringify rs)]
+                                (fn nm :: Name => fn u :: Unit => fn rest :: {Unit} =>
+                                        fn frag : xml lform [] (stringify rest) =>
+                                                <lform><li>{frag} <textbox{nm}/></li></lform>)
+                                <lform></lform>
+                                [rs]}
 
+                        <submit action={handler}/>
+                </lform>
         </body></html>
 end
 
 structure M = F(struct
-        con rs = []
+        con rs = [A, B, C]
 end)
 
 open M