annotate tests/each.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 ccf1d445b794
children
rev   line source
adam@1355 1 sequence s
adam@1355 2 table t : { Id : int, S1 : string, S2:string, S3:string, S4:string }
adam@1355 3
adam@1355 4 fun each (n : int, (f : unit -> transaction unit)) = if n > 0 then f (); each ((n-1),f) else return ()
adam@1355 5
adam@1355 6 fun fill () =
adam@1355 7 dml (DELETE FROM t WHERE 1=1);
adam@1355 8 each (1,( fn () =>
adam@1355 9 (nv <- nextval s;
adam@1355 10 (dml (INSERT INTO t (Id, S1, S2, S3, S4) VALUES ({[nv]}, {["S1"]}, {["S2"]}, {["S3"]}, {["S4"]}))))
adam@1355 11 ));
adam@1355 12 return <xml>done</xml>
adam@1355 13
adam@1355 14 fun main () = return <xml><body>
adam@1355 15 <form><submit action={fill} value="fill"/></form>
adam@1355 16 </body></xml>