diff caching-tests/test.ur @ 2278:b7615e0ac4b0

Fix bug in and clean up free path code.
author Ziv Scully <ziv@mit.edu>
date Tue, 10 Nov 2015 12:35:00 -0500
parents c05f9a5e0f0f
children f8903af753ff
line wrap: on
line diff
--- a/caching-tests/test.ur	Mon Nov 09 13:38:04 2015 -0500
+++ b/caching-tests/test.ur	Tue Nov 10 12:35:00 2015 -0500
@@ -5,23 +5,23 @@
                         FROM tab
                         WHERE tab.Id = {[id]});
     return <xml><body>
-      (* Reading {[id]}. *)
+      cache
       {case res of
            None => <xml>?</xml>
          | Some row => <xml>{[row.Tab.Val]}</xml>}
     </body></xml>
 
-(* fun sillyRecursive {Id = id, FooBar = fooBar} = *)
-(*     if fooBar <= 0 *)
-(*     then 0 *)
-(*     else 1 + sillyRecursive {Id = id, FooBar = fooBar - 1} *)
+fun sillyRecursive {Id = id : int, FooBar = fooBar} =
+    if fooBar <= 0
+    then 0
+    else 1 + sillyRecursive {Id = id, FooBar = fooBar - 1}
 
 fun cacheR (r : {Id : int, FooBar : int}) =
     res <- oneOrNoRows (SELECT tab.Val
                         FROM tab
                         WHERE tab.Id = {[r.Id]});
     return <xml><body>
-      (* Reading {[r.Id]}. *)
+      cacheR {[r.FooBar]}
       {case res of
            None => <xml>?</xml>
          | Some row => <xml>{[row.Tab.Val]}</xml>}