summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--mew.scm9
-rw-r--r--tests/test.mew1
2 files changed, 7 insertions, 3 deletions
diff --git a/mew.scm b/mew.scm
index 92197b3..10a1f41 100644
--- a/mew.scm
+++ b/mew.scm
@@ -191,9 +191,12 @@
   (define-syntax esc
     (syntax-rules ()
       ((_ return body ...)
-       (call-with-current-continuation
-         (lambda (return)
-           (seq body ...))))))
+       (receive vals (call-with-current-continuation
+                      (lambda (return)
+                        (seq body ...)))
+         (if (null? vals)
+           (void)
+           (car vals))))))         
 
   (define-syntax fin
     (syntax-rules ()
diff --git a/tests/test.mew b/tests/test.mew
index 904127d..3af29c0 100644
--- a/tests/test.mew
+++ b/tests/test.mew
@@ -147,6 +147,7 @@
 
 (test-group "esc"
   (test #t (void? (esc ret)))
+  (test #t (void? (esc ret (ret))))
   (test 42 (esc ret
               (* 6 7)))
   (test 42 (esc ret