From 41263c972c2d2892f9bb65e439f1b744a26a271f Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 23 May 2023 21:44:10 -0700 Subject: awk: bug: broken redirection operators. * stdlib/awk.tl (sys:awk-redir): Fix regression from April 2018. The gensym variable introduced must be parallel bound, since it is referenced by the init expression of the other variable. This breaks all awk redirection operators. --- stdlib/awk.tl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/awk.tl b/stdlib/awk.tl index 54d2909c..d82ab8c3 100644 --- a/stdlib/awk.tl +++ b/stdlib/awk.tl @@ -289,8 +289,8 @@ (defmacro sys:awk-redir (aws-sym stream-var kind mode path body) (with-gensyms (res-sym) - ^(let ((,res-sym ,path) - (,stream-var (qref ,aws-sym (ensure-stream ,kind ,res-sym ,mode)))) + ^(let* ((,res-sym ,path) + (,stream-var (qref ,aws-sym (ensure-stream ,kind ,res-sym ,mode)))) ,(if body ^(qref ,aws-sym (close-or-flush ,stream-var ,kind ,res-sym (progn ,*body))) -- cgit v1.2.3