summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-03-11 21:20:09 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2012-03-11 21:20:09 -0400
commit7dcc04f288c27a29e18ad2c0b55d07b218655deb (patch)
treefa4207a3986c005d10f5f95eb8be8dad5f9363c2
parentfe082f71b4e7069908b96efbc7c1645e1d266350 (diff)
Handle recursive RPC handlers
-rw-r--r--src/rpcify.sml2
-rw-r--r--tests/selfRpc.ur7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/rpcify.sml b/src/rpcify.sml
index 8d309a82..f8aee6c7 100644
--- a/src/rpcify.sml
+++ b/src/rpcify.sml
@@ -142,7 +142,7 @@ fun frob file =
decl = fn x => x}
st d
in
- (#export_decls st @ [d],
+ (d :: #export_decls st,
{exported = #exported st,
export_decls = []})
end
diff --git a/tests/selfRpc.ur b/tests/selfRpc.ur
new file mode 100644
index 00000000..a851008d
--- /dev/null
+++ b/tests/selfRpc.ur
@@ -0,0 +1,7 @@
+fun test () =
+ k <- source <xml/>;
+ return <xml><button onclick={r <- rpc (test ()); set k r}/></xml>
+
+fun main () : transaction page =
+ h <- test ();
+ return <xml><body>{h}</body></xml>