diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-04-21 11:38:01 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-04-21 11:38:01 -0700 |
commit | e267c54a321a637ef9353ebf726a57c727abeeb7 (patch) | |
tree | 7e92989f111f882f8cf983967278afb4dee16ba8 | |
parent | 665572cd5e51d0c17be828f0b36a53129fb2f5cd (diff) | |
download | txr-e267c54a321a637ef9353ebf726a57c727abeeb7.tar.gz txr-e267c54a321a637ef9353ebf726a57c727abeeb7.tar.bz2 txr-e267c54a321a637ef9353ebf726a57c727abeeb7.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.
-rw-r--r-- | share/txr/stdlib/awk.tl | 5 |
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)))) |