Mercurial > urweb
comparison caching-tests/test.ur @ 2276:c05f9a5e0f0f
Progress on free paths, but consolidation seems to fail more with them.
author | Ziv Scully <ziv@mit.edu> |
---|---|
date | Mon, 09 Nov 2015 13:37:31 -0500 |
parents | ce96e166d938 |
children | b7615e0ac4b0 |
comparison
equal
deleted
inserted
replaced
2275:ce96e166d938 | 2276:c05f9a5e0f0f |
---|---|
3 fun cache id = | 3 fun cache id = |
4 res <- oneOrNoRows (SELECT tab.Val | 4 res <- oneOrNoRows (SELECT tab.Val |
5 FROM tab | 5 FROM tab |
6 WHERE tab.Id = {[id]}); | 6 WHERE tab.Id = {[id]}); |
7 return <xml><body> | 7 return <xml><body> |
8 Reading {[id]}. | 8 (* Reading {[id]}. *) |
9 {case res of | |
10 None => <xml>?</xml> | |
11 | Some row => <xml>{[row.Tab.Val]}</xml>} | |
12 </body></xml> | |
13 | |
14 (* fun sillyRecursive {Id = id, FooBar = fooBar} = *) | |
15 (* if fooBar <= 0 *) | |
16 (* then 0 *) | |
17 (* else 1 + sillyRecursive {Id = id, FooBar = fooBar - 1} *) | |
18 | |
19 fun cacheR (r : {Id : int, FooBar : int}) = | |
20 res <- oneOrNoRows (SELECT tab.Val | |
21 FROM tab | |
22 WHERE tab.Id = {[r.Id]}); | |
23 return <xml><body> | |
24 (* Reading {[r.Id]}. *) | |
9 {case res of | 25 {case res of |
10 None => <xml>?</xml> | 26 None => <xml>?</xml> |
11 | Some row => <xml>{[row.Tab.Val]}</xml>} | 27 | Some row => <xml>{[row.Tab.Val]}</xml>} |
12 </body></xml> | 28 </body></xml> |
13 | 29 |