diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-09-24 07:23:58 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-09-24 07:23:58 -0700 |
commit | 97870898a2491242223a64715871cec339c42517 (patch) | |
tree | 78cb5f58277872819d67fa82d48ef10967ec8413 /txr.1 | |
parent | c99a38dde59aa8b0c2496fef092a93e324ec3e33 (diff) | |
download | txr-97870898a2491242223a64715871cec339c42517.tar.gz txr-97870898a2491242223a64715871cec339c42517.tar.bz2 txr-97870898a2491242223a64715871cec339c42517.zip |
awk macro: use range test logic for clause conditions.
* share/txr/stdlib/awk.tl (sys:range-test): Function renamed
to sys:awk-test, since it's not just for ranges.
(sys:awk-let): Uses of sys:range-test follow rename.
sys:awk-test introduced into expansion of cond parts
of cond-action clauses.
* txr.1: Documented new behavior (conditions can produce
a function or regex, which is implicitly invoked on rec).
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -38320,7 +38320,17 @@ variable, and various variables are updated. Then, the condition-action clauses are processed, in the order in which they appear. Each .meta condition -is evaluated. If it yields true, then its associated +is evaluated. If the resulting value is a regular expression +or a function, then this regular expression or function is invoked on the value +stored in the record variable +.codn rec , +and the result is taken to be the truth value of +.metn condition . +Otherwise, if the resulting value of +.meta condition +is other than a function or regular expression, it is taken directly +to be the truth value. +If the condition is true, then its associated .meta action forms are evaluated. Either way, processing passes to the next condition clause (unless an explicit step is taken in one of the |