diff options
author | Colin Okay <cbeok@protonmail.com> | 2020-07-14 13:30:23 -0500 |
---|---|---|
committer | Colin Okay <cbeok@protonmail.com> | 2020-07-14 13:30:23 -0500 |
commit | 8c4ddae952469d7c97ccea76c8c8894b7be925e1 (patch) | |
tree | 16816bb0c0195a538335522d6bc69705185ca01e | |
parent | cf4317625629a3a80dc05eb8ea48f32a59dec430 (diff) |
putting for's body in unwind protect
-rw-r--r-- | gtwiwtg.lisp | 9 |
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) |