1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-31 09:20:23 +02:00

Primitives create multiple argument continuations.

This commit is contained in:
Ian Price 2015-06-16 23:06:47 +01:00
parent 5827ad4f03
commit 56e6c33264

View file

@ -305,10 +305,9 @@ var abort_to_prompt = function(self, k, prompt, arg) {
var kont = undefined; // actual value doesn't matter var kont = undefined; // actual value doesn't matter
if (!scheme.is_true(spec[1])) { if (!scheme.is_true(spec[1])) {
// TODO: handle multivalue continations var f = function (self, k2) {
// compare with callcc var args = Array.prototype.slice.call(arguments, 2);
var f = function (self, k2, val) { return k.apply(k,args);
return k(val);
}; };
kont = new scheme.Closure(f, 0); 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 call_with_values = not_implemented_yet;
var callcc = function (self, k, closure) { var callcc = function (self, k, closure) {
var f = function (self, k2, val) { var f = function (self, k2) {
return k(val); var args = Array.prototype.slice.call(arguments, 2);
return k.apply(k,args);
}; };
return closure.fun(closure, k, new scheme.Closure(f, 0)); return closure.fun(closure, k, new scheme.Closure(f, 0));
}; };