summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-09-25 07:57:34 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-09-25 07:57:34 -0700
commite4ad31de61b548238cb53b6a572dc7f16d93d78f (patch)
tree446c39df075843aa44639d04695a98671b94c253 /txr.1
parent0ad39c713f1d0239abda6cece563c0964a1ea5e0 (diff)
downloadtxr-e4ad31de61b548238cb53b6a572dc7f16d93d78f.tar.gz
txr-e4ad31de61b548238cb53b6a572dc7f16d93d78f.tar.bz2
txr-e4ad31de61b548238cb53b6a572dc7f16d93d78f.zip
awk macro: loop uses closure to read records.
* share/txr/stdlib/awk.tl (sys:awk-state loop): Refactor code so that record-processing loop obtains a lambda which is called to extract a record. If rs and krs did not change, then the same lambda is obtained from a variable which caches it. The get-rec-reader local function thus encapsulates the whole record delimiting strategy as well as changes to the variables. With this structure, it will be relatively easy to add support for Awk's paragraph mode, which is notably missing in the implementation.
Diffstat (limited to 'txr.1')
0 files changed, 0 insertions, 0 deletions