From aed3aa32e62846a16da55fc7be4cecba92ed5e2b 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 +++++++++++++++++++++++++++++++++ tests/rpcM.urp | 5 +++++ 2 files changed, 38 insertions(+) create mode 100644 tests/rpcM.ur create mode 100644 tests/rpcM.urp (limited to 'tests') 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 +