aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtwiwtg.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'gtwiwtg.lisp')
-rw-r--r--gtwiwtg.lisp9
1 files changed, 5 insertions, 4 deletions
diff --git a/gtwiwtg.lisp b/gtwiwtg.lisp
index 14c0048..10eb1ab 100644
--- a/gtwiwtg.lisp
+++ b/gtwiwtg.lisp
@@ -779,10 +779,11 @@ A -- 4
`(let ((,var-exp (next ,gen-var))) ,@body))))
`(let ((,gen-var ,gen))
(assert (typep ,gen-var 'gtwiwtg::generator!))
- (loop
- :while (has-next-p ,gen-var)
- :do
- ,expr-body)
+ (unwind-protect
+ (loop
+ :while (has-next-p ,gen-var)
+ :do
+ ,expr-body))
(stop ,gen-var))))
(defmacro fold ((acc init-val) (var-exp gen) expr)