diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-10-25 15:29:21 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-10-25 15:29:21 -0400 |
commit | e6cdd060b73ad081dd3dab2e278b994e9442c6da (patch) | |
tree | e7763596f996cbc602dfbefff837b20da643bbba /lib | |
parent | ad7be9f6f9b4bfd6d6a4653b5eed4783a6ddb96e (diff) |
Use call/cc for recv and sleep
Diffstat (limited to 'lib')
-rw-r--r-- | lib/js/urweb.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 6ca4becd..62f94f52 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -779,10 +779,10 @@ function rv(chn, parse, k) { var msg = dequeue(ch.msgs); if (msg == null) { - enqueue(ch.listeners, function(msg) { execF(execF(k, parse(msg)), null); }); + enqueue(ch.listeners, function(msg) { k(parse(msg)); }); } else { try { - execF(execF(k, parse(msg)), null); + k(parse(msg)); } catch (v) { doExn(v); } @@ -790,7 +790,11 @@ function rv(chn, parse, k) { } function sl(ms, k) { - window.setTimeout(function() { execF(k, null); }, ms); + window.setTimeout(function() { k(null); }, ms); +} + +function sp(e) { + execF(e, null); } |