summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-10-28 20:18:20 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-10-28 20:18:20 -0700
commita5ef086fc33cfbfce7b03bad291efa28acf739b2 (patch)
treeb6658f3ecbc98054217f72a166b02bfdb0b029e0 /share
parent67af4be97a2ea8700a841feb893a1f1747987843 (diff)
downloadtxr-a5ef086fc33cfbfce7b03bad291efa28acf739b2.tar.gz
txr-a5ef086fc33cfbfce7b03bad291efa28acf739b2.tar.bz2
txr-a5ef086fc33cfbfce7b03bad291efa28acf739b2.zip
Implementing sys:abscond-from operator.
* eval.c (sys_abscond_from_s): New symbol variable. (op_abscond_from): New static function. (do_expand): Handle abscond-from like return-from. (eval_init): Initialize sys_abscond_from_s and register sys:abscond-from operator. * share/txr/stdlib/yield.tl (yield-from): Use sys:abscond-from instead of return-from, to avoid tearing down the continuation's resources that it may need when restarted. * txr.1: Documented sys:abscond-from and added a mention to the Delimited Continuations introduction. * unwind.c (uw_abscond_to_exit_point): New static function. (uw_block_abscond): New function. * unwind.h (uw_block_abscond): Declared.
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/yield.tl5
1 files changed, 3 insertions, 2 deletions
diff --git a/share/txr/stdlib/yield.tl b/share/txr/stdlib/yield.tl
index 0a623a2b..ef0518e6 100644
--- a/share/txr/stdlib/yield.tl
+++ b/share/txr/stdlib/yield.tl
@@ -51,8 +51,9 @@
(let ((cont-sym (gensym)))
^(sys:yield-impl ',name
(lambda (,cont-sym)
- (return-from ,name (new (sys:yld-item
- ,form (cdr ,cont-sym)))))
+ (sys:abscond-from ,name
+ (new (sys:yld-item
+ ,form (cdr ,cont-sym)))))
',ctx-form)))
(defmacro yield (form)