From 97870898a2491242223a64715871cec339c42517 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 24 Sep 2016 07:23:58 -0700 Subject: 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). --- txr.1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index d57dd04f..b77f6b52 100644 --- a/txr.1 +++ b/txr.1 @@ -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 -- cgit v1.2.3