diff demo/crud.ur @ 455:d4a81273d4b1

Nested demo
author Adam Chlipala <adamc@hcoop.net>
date Tue, 04 Nov 2008 09:33:35 -0500
parents c471345f5165
children 20fab0e96217
line wrap: on
line diff
--- a/demo/crud.ur	Sat Nov 01 21:24:43 2008 -0400
+++ b/demo/crud.ur	Tue Nov 04 09:33:35 2008 -0500
@@ -100,9 +100,9 @@
                                                        sql_exp [] [] [] t.1) cols)]
                               (fn (nm :: Name) (t :: (Type * Type)) (rest :: {(Type * Type)})
                                                [[nm] ~ rest] =>
-                               fn input col acc => acc with nm = @sql_inject col.Inject (col.Parse input))
+                               fn input col acc => acc ++ {nm = @sql_inject col.Inject (col.Parse input)})
                               {} [M.cols] inputs M.cols
-                     with #Id = (SQL {id})));
+                     ++ {Id = (SQL {id})}));
         ls <- list ();
         return <xml><body>
           <p>Inserted with ID {[id]}.</p>
@@ -119,8 +119,8 @@
                                                                [] [] t.1) cols)]
                               (fn (nm :: Name) (t :: (Type * Type)) (rest :: {(Type * Type)})
                                                [[nm] ~ rest] =>
-                               fn input col acc => acc with nm =
-                                                            @sql_inject col.Inject (col.Parse input))
+                               fn input col acc => acc ++ {nm =
+                                                           @sql_inject col.Inject (col.Parse input)})
                               {} [M.cols] inputs M.cols)
                     tab (WHERE T.Id = {id}));
         ls <- list ();