diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-12-01 06:49:26 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-12-01 06:49:26 -0800 |
commit | 98ee5f2a78af025538662cd3aab877a405cb97f1 (patch) | |
tree | a517afa3a99a0666ca5463c2ce71ba663a28fb30 /txr.1 | |
parent | 203b85801e0bade02af3b9e09205041e97771799 (diff) | |
download | txr-98ee5f2a78af025538662cd3aab877a405cb97f1.tar.gz txr-98ee5f2a78af025538662cd3aab877a405cb97f1.tar.bz2 txr-98ee5f2a78af025538662cd3aab877a405cb97f1.zip |
Awk macro prn becomes function.
* share/txr/stdlib/awk.tl (sys:awk-let): Renamed to
sys:awk-mac-let. Macrolet prn removed from here.
(sys:awk-fun-let): New macro, provides awk functions.
The prn function removed from sys:awk-mac-let is generated
here.
(sys:awk-fun-shadowing-env): New function.
(awk): Follow rename of sys:awk-let. When expanding p-action
forms, use only sys:awk-mac-let; do not include the awk
functions, which do not "vaporize" unlike local macros. To
compensate for not including the functions, extend the macro
environment with one that shadows the functions, so that
during this expansion, any global macros of the same name as
awk local functions are properlly hidden. In the final
expansion, include the awk functions.
* txr.1: Updated documentation to consistently call
prn an awk function everywhere.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -41267,7 +41267,7 @@ forms, the .code awk macro substitutes the single action equivalent to the form .codn "(prn)" : -a call to the local awk macro +a call to the local awk function .codn prn . The behavior of this macro, when called with no arguments, as above, is to print the current @@ -41328,10 +41328,15 @@ If multiple clauses are present, they are effectively consolidated into a single clause, in the order they appear. -Note that the lexical variables and macros established by the +Note that the lexical variables, functions and macros established by the .code awk macro -(awk macros and awk variables) are in an inner scope relative to +(called, respectively, +.IR "awk macros" , +.I "awk functions" +and +.IR "awk variables" ) +are in an inner scope relative to .code :let bindings. For instance if .code :let @@ -42055,7 +42060,7 @@ consisting of a single space character. When the .code prn -macro prints two or more arguments, or fields, +function prints two or more arguments, or fields, the value of .code ofs is used to separate them. @@ -42081,7 +42086,7 @@ variable in Awk. Each call to the .code prn -macro terminates its output by emitting the value of +function terminates its output by emitting the value of .codn ors . The initial value of @@ -42089,14 +42094,14 @@ The initial value of is a character string consisting of a single newline, and so the .code prn -macro prints lines. +function prints lines. -.coNP Macro @ prn +.coNP Function @ prn .synb .mets (prn << form *) .syne .desc -The awk macro +The awk function .code prn performs output into the .code *stdout* |