summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-12-20 04:00:22 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-12-20 04:00:22 -0800
commit7c5b70d7d17faf6543350dffe56292e3f7dff679 (patch)
tree522550ef5e10d87961191dad88e4c6c2c10dac4d /txr.1
parent59ddd76e362196ac68ab291b9a76a55fd257d29c (diff)
downloadtxr-7c5b70d7d17faf6543350dffe56292e3f7dff679.tar.gz
txr-7c5b70d7d17faf6543350dffe56292e3f7dff679.tar.bz2
txr-7c5b70d7d17faf6543350dffe56292e3f7dff679.zip
awk macro: endpont-exclusive ranges.
* share/txr/stdlib/awk.tl (sys:awk-mac-let): Local macro sys:rng generalized to support code generation for ranges that exclude either endpoint. Local rng macro adjusted to target this new form. Local macros rng-, -rng, and -rng- added. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.130
1 files changed, 29 insertions, 1 deletions
diff --git a/txr.1 b/txr.1
index 5f5d1ef9..73129a1a 100644
--- a/txr.1
+++ b/txr.1
@@ -42464,9 +42464,12 @@ next one. If there is no next input source,
.code awk
terminates.
-.coNP Macro @ rng
+.coNP Macros @, rng @, -rng @ rng- and @ -rng-
.synb
.mets (rng < from-condition << to-condition )
+.mets (-rng < from-condition << to-condition )
+.mets (rng- < from-condition << to-condition )
+.mets (-rng- < from-condition << to-condition )
.syne
.desc
The awk macro
@@ -42483,6 +42486,31 @@ is found to be true, and ends when
is true. Over this interval, range is said to be
.IR active .
+The
+.code rng
+macro's result value is true for the starting record which matches
+.metn from-condition ,
+the final record which matches
+.metn to-condition ,
+and all records in between, if any.
+The remaining macros work exactly like
+.codn rng ,
+identifying the active range in the same manner. They differ
+in that the Boolean value they produce excludes the starting record,
+final record, or both, depending on which macro. The
+.code -rng
+macro yields
+.code nil
+for the initial record. The
+.code rng-
+macro yields
+.code nil
+for the final record. The
+.code -rng-
+macro yields
+.code nil
+for both the initial and final record.
+
Ranges expressed using
.code rng
may combine with other expressions, including