guile-commits
[Top][All Lists]
Advanced

[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));
 };



reply via email to

[Prev in Thread] Current Thread [Next in Thread]