diff options
author | Ziv Scully <ziv@mit.edu> | 2015-11-09 13:37:31 -0500 |
---|---|---|
committer | Ziv Scully <ziv@mit.edu> | 2015-11-09 13:37:31 -0500 |
commit | aa2c8c64542d7930773da26573e186ec3753c268 (patch) | |
tree | a5b38a3ba9faa66bec88afc89df8c93b51508318 /caching-tests/test.ur | |
parent | 1c2069212a7dec30db45e02391d7ca0154cd5709 (diff) |
Progress on free paths, but consolidation seems to fail more with them.
Diffstat (limited to 'caching-tests/test.ur')
-rw-r--r-- | caching-tests/test.ur | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/caching-tests/test.ur b/caching-tests/test.ur index e08c6e47..0549840d 100644 --- a/caching-tests/test.ur +++ b/caching-tests/test.ur @@ -5,7 +5,23 @@ fun cache id = FROM tab WHERE tab.Id = {[id]}); return <xml><body> - Reading {[id]}. + (* Reading {[id]}. *) + {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 cacheR (r : {Id : int, FooBar : int}) = + res <- oneOrNoRows (SELECT tab.Val + FROM tab + WHERE tab.Id = {[r.Id]}); + return <xml><body> + (* Reading {[r.Id]}. *) {case res of None => <xml>?</xml> | Some row => <xml>{[row.Tab.Val]}</xml>} |