mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-30 00:40:20 +02:00
Primitives create multiple argument continuations.
This commit is contained in:
parent
5827ad4f03
commit
56e6c33264
1 changed files with 6 additions and 6 deletions
|
@ -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));
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue