Mercurial > urweb
annotate demo/subforms.ur @ 1909:659d1f4e95bf
make dist: Use fewer wildcards
The remaining ones only work by accident:
http://www.gnu.org/software/automake/manual/html_node/Wildcards.html
and they have some practical problems too (we don?t really want to
distribute include/urweb/config.h or src/config.sml), but this is
enough for now to pass ?make distcheck? as long as we don?t run it
from a separate build directory.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
Makefile.am | 6 +++---
src/c/Makefile.am | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
author | Anders Kaseorg <andersk@mit.edu> |
---|---|
date | Fri, 22 Nov 2013 09:36:14 -0500 |
parents | be0c4e2e488a |
children |
rev | line source |
---|---|
adamc@780 | 1 fun sub r = |
adamc@780 | 2 let |
adamc@780 | 3 fun sub' ls = |
adamc@780 | 4 case ls of |
adamc@780 | 5 [] => <xml/> |
adamc@780 | 6 | r :: ls => <xml> |
adamc@780 | 7 <li>{[r.Num]} = {[r.Text]}</li> |
adamc@780 | 8 {sub' ls} |
adamc@780 | 9 </xml> |
adamc@780 | 10 in |
adamc@780 | 11 return <xml><body> |
adamc@780 | 12 {sub' r.Lines} |
adamc@780 | 13 </body></xml> |
adamc@780 | 14 end |
adamc@780 | 15 |
adam@1833 | 16 fun subfrms n = |
adamc@780 | 17 if n <= 0 then |
adamc@780 | 18 <xml/> |
adamc@780 | 19 else |
adamc@780 | 20 <xml> |
adamc@780 | 21 <entry> |
adamc@780 | 22 <hidden{#Num} value={show n}/> |
adamc@780 | 23 <li>{[n]}: <textbox{#Text}/></li> |
adamc@780 | 24 </entry> |
adam@1833 | 25 {subfrms (n - 1)} |
adamc@780 | 26 </xml> |
adamc@780 | 27 |
adamc@780 | 28 fun form n = return <xml><body> |
adamc@780 | 29 <form> |
adamc@780 | 30 <subforms{#Lines}> |
adam@1833 | 31 {subfrms n} |
adamc@780 | 32 </subforms> |
adamc@780 | 33 <submit action={sub}/> |
adamc@780 | 34 </form> |
adamc@780 | 35 |
adamc@780 | 36 <a link={form (n + 1)}>One more blank</a><br/> |
adamc@780 | 37 {if n > 0 then |
adamc@780 | 38 <xml><a link={form (n - 1)}>One fewer blank</a></xml> |
adamc@780 | 39 else |
adamc@780 | 40 <xml/>} |
adamc@780 | 41 </body></xml> |
adamc@780 | 42 |
adamc@780 | 43 fun main () = form 1 |