summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-04-21 11:38:01 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-04-21 11:38:01 -0700
commit969b24f06ad615f56f452c87cf2735b5978c754f (patch)
tree7e92989f111f882f8cf983967278afb4dee16ba8 /share
parentaa1617b497a7eb4a340586f4ec410f4bb8ae38aa (diff)
downloadtxr-969b24f06ad615f56f452c87cf2735b5978c754f.tar.gz
txr-969b24f06ad615f56f452c87cf2735b5978c754f.tar.bz2
txr-969b24f06ad615f56f452c87cf2735b5978c754f.zip
awk: bug: multiple expansion in redirection macros.
share/txr/stdlib/awk.tl (sys:awk-redir): Put the unused gensym to use: evaluate the path expressio nonce into the gensym variable. Also move strangely place comma.
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/awk.tl5
1 files changed, 3 insertions, 2 deletions
diff --git a/share/txr/stdlib/awk.tl b/share/txr/stdlib/awk.tl
index dee43dcd..a0e2a39e 100644
--- a/share/txr/stdlib/awk.tl
+++ b/share/txr/stdlib/awk.tl
@@ -287,9 +287,10 @@
(defmacro sys:awk-redir (aws-sym stream-var kind mode path body)
(with-gensyms (res-sym)
- ^(let ((,stream-var (qref ,aws-sym (ensure-stream ,kind ,path, 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 ,path
+ ^(qref ,aws-sym (close-or-flush ,stream-var ,kind ,res-sym
(progn ,*body)))
stream-var))))