From 8c4ddae952469d7c97ccea76c8c8894b7be925e1 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Tue, 14 Jul 2020 13:30:23 -0500 Subject: putting for's body in unwind protect --- gtwiwtg.lisp | 9 +++++---- 1 file 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) -- cgit v1.2.3