summaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
Diffstat (limited to 'demo')
-rw-r--r--demo/batch.ur7
-rw-r--r--demo/batchFun.ur6
-rw-r--r--demo/chat.ur2
-rw-r--r--demo/increment.ur2
-rw-r--r--demo/noisy.ur6
-rw-r--r--demo/roundTrip.ur2
6 files changed, 13 insertions, 12 deletions
diff --git a/demo/batch.ur b/demo/batch.ur
index 4100749f..8213dd81 100644
--- a/demo/batch.ur
+++ b/demo/batch.ur
@@ -25,7 +25,8 @@ fun show withDel lss =
Nil => <xml/>
| Cons ((id, a), ls) => <xml>
<tr><td>{[id]}</td> <td>{[a]}</td> {if withDel then
- <xml><td><button value="Delete" onclick={del id}/></td></xml>
+ <xml><td><button value="Delete" onclick={rpc (del id)}/>
+ </td></xml>
else
<xml/>} </tr>
{show' ls}
@@ -55,7 +56,7 @@ fun main () =
fun exec () =
ls <- get batched;
- doBatch ls;
+ rpc (doBatch ls);
set batched Nil
in
return <xml><body>
@@ -63,7 +64,7 @@ fun main () =
{show True lss}
- <button value="Update" onclick={ls <- allRows (); set lss ls}/><br/>
+ <button value="Update" onclick={ls <- rpc (allRows ()); set lss ls}/><br/>
<br/>
<h2>Batch new rows to add</h2>
diff --git a/demo/batchFun.ur b/demo/batchFun.ur
index 560c0c55..d88f11ca 100644
--- a/demo/batchFun.ur
+++ b/demo/batchFun.ur
@@ -78,7 +78,7 @@ functor Make(M : sig
<xml><td>{m.Show v}</td></xml>)
[M.cols] M.fl M.cols (r -- #Id)}
{if withDel then
- <xml><td><button value="Delete" onclick={del r.Id}/></td></xml>
+ <xml><td><button value="Delete" onclick={rpc (del r.Id)}/></td></xml>
else
<xml/>}
</tr>
@@ -129,7 +129,7 @@ functor Make(M : sig
fun exec () =
ls <- get batched;
- doBatch ls;
+ rpc (doBatch ls);
set batched Nil
in
return <xml><body>
@@ -137,7 +137,7 @@ functor Make(M : sig
{show True lss}
- <button value="Update" onclick={ls <- allRows (); set lss ls}/><br/>
+ <button value="Update" onclick={ls <- rpc (allRows ()); set lss ls}/><br/>
<br/>
<h2>Batch new rows to add</h2>
diff --git a/demo/chat.ur b/demo/chat.ur
index 52c344be..9f18e9ef 100644
--- a/demo/chat.ur
+++ b/demo/chat.ur
@@ -35,7 +35,7 @@ fun chat id () =
fun doSpeak () =
line <- get newLine;
set newLine "";
- speak line
+ rpc (speak line)
in
return <xml><body onload={onload ()}>
<h1>{[r.T.Title]}</h1>
diff --git a/demo/increment.ur b/demo/increment.ur
index a74e80df..532ceb83 100644
--- a/demo/increment.ur
+++ b/demo/increment.ur
@@ -6,5 +6,5 @@ fun main () =
src <- source 0;
return <xml><body>
<dyn signal={n <- signal src; return <xml>{[n]}</xml>}/>
- <button value="Update" onclick={n <- increment (); set src n}/>
+ <button value="Update" onclick={n <- rpc (increment ()); set src n}/>
</body></xml>
diff --git a/demo/noisy.ur b/demo/noisy.ur
index 708cfa2c..068e2ec1 100644
--- a/demo/noisy.ur
+++ b/demo/noisy.ur
@@ -19,7 +19,7 @@ fun check ls =
case ls of
Nil => return ()
| Cons (id, ls') =>
- ao <- lookup id;
+ ao <- rpc (lookup id);
alert (case ao of
None => "Nada"
| Some a => a);
@@ -34,10 +34,10 @@ fun main () =
return <xml><body>
<button value="Check values of 1, 2, and 3" onclick={check (Cons (1, Cons (2, Cons (3, Nil))))}/><br/>
<br/>
- <button value="Add" onclick={id <- get idAdd; a <- get aAdd; add (readError id) a}/>
+ <button value="Add" onclick={id <- get idAdd; a <- get aAdd; rpc (add (readError id) a)}/>
<ctextbox source={idAdd}/>
<ctextbox source={aAdd}/><br/>
<br/>
- <button value="Delete" onclick={id <- get idDel; del (readError id)}/>
+ <button value="Delete" onclick={id <- get idDel; rpc (del (readError id))}/>
<ctextbox source={idDel}/>
</body></xml>
diff --git a/demo/roundTrip.ur b/demo/roundTrip.ur
index c3a111b7..aa7017a0 100644
--- a/demo/roundTrip.ur
+++ b/demo/roundTrip.ur
@@ -21,7 +21,7 @@ fun action () =
fun sender s n f =
sleep 2000;
- writeBack (s, n, f);
+ rpc (writeBack (s, n, f));
sender (s ^ "!") (n + 1) (f + 1.23)
in
return <xml><body onload={spawn (receiver ()); sender "" 0 0.0}>