From 2b9a7afa2abf672396d5ee38d9301f88b9a06dff Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 8 Mar 2009 20:34:21 -0400 Subject: Conversion of functions to CPS, to facilitate ServerCall --- tests/rpcM.ur | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/rpcM.ur (limited to 'tests/rpcM.ur') diff --git a/tests/rpcM.ur b/tests/rpcM.ur new file mode 100644 index 00000000..4cd4b86b --- /dev/null +++ b/tests/rpcM.ur @@ -0,0 +1,33 @@ +datatype list t = Nil | Cons of t * list t + +sequence s + +fun main () : transaction page = + let + fun getIndices srcs = + case srcs of + Nil => return Nil + | Cons (src, srcs') => + i <- nextval s; + set src i; + ls <- getIndices srcs'; + return (Cons (i, ls)) + + fun show ls = + case ls of + Nil => + | Cons (x, ls') => {[x]}
{show ls'}
+ in + src1 <- source 0; + src2 <- source 1; + s <- source Nil; + return +