summaryrefslogtreecommitdiffstats
path: root/stdlib/getput.tl
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/getput.tl')
-rw-r--r--stdlib/getput.tl6
1 files changed, 6 insertions, 0 deletions
diff --git a/stdlib/getput.tl b/stdlib/getput.tl
index 0cf751a1..a1be729e 100644
--- a/stdlib/getput.tl
+++ b/stdlib/getput.tl
@@ -187,3 +187,9 @@
(defun command-put-jsons (cmd seq : flat-p mopt)
(with-stream (s (open-command cmd `w@mopt`))
(put-jsons seq s flat-p)))
+
+(defmacro close-lazy-streams (. body)
+ ^(let ((sys:*lazy-streams*))
+ (unwind-protect
+ (progn ,*body))
+ (mapdo (fun close-stream) sys:*lazy-streams*)))