summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/yield.tl7
1 files changed, 5 insertions, 2 deletions
diff --git a/share/txr/stdlib/yield.tl b/share/txr/stdlib/yield.tl
index ea9bb4d2..236faaa8 100644
--- a/share/txr/stdlib/yield.tl
+++ b/share/txr/stdlib/yield.tl
@@ -31,6 +31,7 @@
(let ((yi (call fun reply)))
(cond
((eq (typeof yi) 'sys:yld-item)
+ (call fun 'sys:cont-free)
(set fun yi.cont)
yi.val)
(t yi))))
@@ -44,8 +45,10 @@
(cdr cont))))
(defmacro obtain (. body)
- (let ((ignored (gensym "ign")))
- ^(sys:obtain-impl (lambda (,ignored) ,*body))))
+ (let ((arg (gensym "arg")))
+ ^(sys:obtain-impl (lambda (,arg)
+ (unless (eq ,arg 'sys:cont-free)
+ ,*body)))))
(defmacro obtain-block (name . body)
^(obtain (block ,name ,*body)))