diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-09-24 07:56:27 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-09-24 07:56:27 -0700 |
commit | 377a5875a09abed9ee7a64237f666d838f8bbd01 (patch) | |
tree | d576c973f5faf4c3ef9f6efa5e635fa183998b3a /txr.1 | |
parent | a366b6a58bb18d1dec861978a0898a439461de2f (diff) | |
download | txr-377a5875a09abed9ee7a64237f666d838f8bbd01.tar.gz txr-377a5875a09abed9ee7a64237f666d838f8bbd01.tar.bz2 txr-377a5875a09abed9ee7a64237f666d838f8bbd01.zip |
awk macro: add orec variable.
* share/txr/stdlib/awk.tl (sys:awk-state): New slot,
orig-rec.
(sys:awk-state loop): Initialize orig-rec after reading
each record.
(sys:awk-let): Provide orec symbol macro.
* txr.1: Document orec variable.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 29 |
1 files changed, 28 insertions, 1 deletions
@@ -38346,7 +38346,7 @@ switches to the next input source. When there are no more input sources, the macro terminates. .RE -.coNP Variable @ rec +.coNP Variables @ rec and @ orec .desc The awk variable .code rec @@ -38368,6 +38368,33 @@ and these fields are assigned to the field list At the same time, the .code nf variable is updated to reflect the new number of fields. +Likewise, modification of these variables causes +.code rec +to be reconstructed by a catenation of the textual representation +of the fields in +.code f +separated by copies of the output field separator +.codn ofs . + +The +.code orec +variable ("original record") also holds the current record. It is automatically +updated prior to the processing of the condition-clauses at the same time as +.code rec +with the same contents. Like +.codn rec , +it is initially +.code nil +before the first record is read. The +.code orec +variable is unaffected by modification of +the variables +.codn rec , +.code f +and +.codn nf . +It may be assigned. Doing so has no effect on any other +variable. .coNP Variable @ f .desc |