diff options
-rw-r--r-- | share/txr/stdlib/awk.tl | 3 | ||||
-rw-r--r-- | txr.1 | 19 |
2 files changed, 7 insertions, 15 deletions
diff --git a/share/txr/stdlib/awk.tl b/share/txr/stdlib/awk.tl index 45a655bd..fd4788da 100644 --- a/share/txr/stdlib/awk.tl +++ b/share/txr/stdlib/awk.tl @@ -211,7 +211,8 @@ ,*(if awc.inputs ^(inputs (list ,*awc.inputs))) ,*(if awc.output ^(output ,awc.output)) rng-n (macro-time (qref ,awc nranges)))) - (*stdout* (qref ,aws-sym output)) + ,*(if awc.output + ^((*stdout* (qref ,aws-sym output)))) ,*(if awc.begin-file-actions ^((,awk-begf-fun (lambda (,aws-sym) ,*awc.begin-file-actions)))) @@ -37345,24 +37345,15 @@ clause is processed just after the clause. It must have exactly one argument, which is an expression that evaluates to a string, or else to an output stream. If it evaluates to a string, then that string is used as the name -of a file to open for writing. - -If the -.code :output -clause is omitted, then the current value of the -.code *stdout* -stream is used: the value which that special -variable has on entry into the code generated by the -.code awk -macro. +of a file to open for writing, and the resulting stream +is taken in place of that string. The .code :output -clause has the effect of creating a local binding for the +clause, if present, has the effect of creating a local binding for the .code *stdout* -special variable within the dynamic scope of the -.code awk -macro. This new value of +special variable. +This new value of .code *stdout* is visible to all forms within the macro. If a |