From d6f725293fdfd7d28ab5938256866b1fd3b49fe1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 14 Sep 2016 20:52:11 -0700 Subject: awk macro: don't bind *stdout* if :output missing. * share/txr/stdlib/awk.tl (awk): Bind *stdout* only if awc.output is not nil; i.e. :output has been specified (with a non-nil argument). * txr.1: Revised :output documentation. --- txr.1 | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index 47a4f0aa..96b15fe8 100644 --- a/txr.1 +++ b/txr.1 @@ -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 -- cgit v1.2.3