[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 24/99: Primitives create multiple argument continuations
From: |
Christopher Allan Webber |
Subject: |
[Guile-commits] 24/99: Primitives create multiple argument continuations. |
Date: |
Sun, 10 Oct 2021 21:50:47 -0400 (EDT) |
cwebber pushed a commit to branch compile-to-js-merge
in repository guile.
commit 56e6c33264e848592b74b936bdf89fdfd8c874a4
Author: Ian Price <ianprice90@googlemail.com>
AuthorDate: Tue Jun 16 23:06:47 2015 +0100
Primitives create multiple argument continuations.
---
module/language/js-il/runtime.js | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/module/language/js-il/runtime.js b/module/language/js-il/runtime.js
index 319c432..5b4089e 100644
--- a/module/language/js-il/runtime.js
+++ b/module/language/js-il/runtime.js
@@ -305,10 +305,9 @@ var abort_to_prompt = function(self, k, prompt, arg) {
var kont = undefined; // actual value doesn't matter
if (!scheme.is_true(spec[1])) {
- // TODO: handle multivalue continations
- // compare with callcc
- var f = function (self, k2, val) {
- return k(val);
+ var f = function (self, k2) {
+ var args = Array.prototype.slice.call(arguments, 2);
+ return k.apply(k,args);
};
kont = new scheme.Closure(f, 0);
};
@@ -323,8 +322,9 @@ var abort_to_prompt = function(self, k, prompt, arg) {
var call_with_values = not_implemented_yet;
var callcc = function (self, k, closure) {
- var f = function (self, k2, val) {
- return k(val);
+ var f = function (self, k2) {
+ var args = Array.prototype.slice.call(arguments, 2);
+ return k.apply(k,args);
};
return closure.fun(closure, k, new scheme.Closure(f, 0));
};
- [Guile-commits] 96/99: Fix cps's choose-compiler to be able to compile javascript, (continued)
- [Guile-commits] 96/99: Fix cps's choose-compiler to be able to compile javascript, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 98/99: Merge branch 'main' into compile-to-js-merge, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 78/99: Implement Hook Builtins, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 81/99: Argument to make-fluid is optional, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 83/99: Implement variable-bound? builtin, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 88/99: read argument to --depends switch, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 89/99: extra-dependencies go before boot-dependencies, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 90/99: Mention all arguments to guild jslink in --help, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 92/99: Merge branch 'compile-to-js-2017' into compile-to-js-rebase, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 99/99: Compile cps to bytecode by default, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 24/99: Primitives create multiple argument continuations.,
Christopher Allan Webber <=
- [Guile-commits] 14/99: Add binop type, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 53/99: Implement Winding & Unwinding, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 63/99: Implement hashtable built-ins, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 66/99: Implement misc built-ins, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 61/99: define! primitive only takes one argument., Christopher Allan Webber, 2021/10/10
- [Guile-commits] 69/99: Unwind prompt frames, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 67/99: Make child structs applicable., Christopher Allan Webber, 2021/10/10
- [Guile-commits] 74/99: Reimplement JS module system primitives., Christopher Allan Webber, 2021/10/10
- [Guile-commits] 95/99: Fix import of lower-cps in compile-js.scm, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 73/99: Implement unboxed integer primitives., Christopher Allan Webber, 2021/10/10