summaryrefslogtreecommitdiffstats
path: root/autoload.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-12-30 15:05:30 -0800
committerKaz Kylheku <kaz@kylheku.com>2022-12-30 15:05:30 -0800
commit4b29e91a09e09ce66060e2be30e1707943e49a85 (patch)
tree3918df625518aba62a16ef86564efd480c7ce15d /autoload.c
parente4c591c3ff02733fd115343d0212e9083be93b8f (diff)
downloadtxr-4b29e91a09e09ce66060e2be30e1707943e49a85.tar.gz
txr-4b29e91a09e09ce66060e2be30e1707943e49a85.tar.bz2
txr-4b29e91a09e09ce66060e2be30e1707943e49a85.zip
awk: new feature, res variable.
The res variable captures the specific value of the condition expression, making it available to the action. * autoload.c (awk_set_entries): Intern the res symbol * stdlib/awk.tl (awk): Instead of generating the condition-action into a simple when, we use whenlet to also bind the res variable. * tests/015/awk-res.tl: New file. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'autoload.c')
-rw-r--r--autoload.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/autoload.c b/autoload.c
index 30d388ba..72e89e9e 100644
--- a/autoload.c
+++ b/autoload.c
@@ -352,6 +352,7 @@ static val awk_set_entries(val fun)
lit("<-"), lit("!>"), lit("<!"), lit("prn"),
lit("i"), lit("o"), lit("x"), lit("b"), lit("c"), lit("r"),
lit("iz"), lit("oz"), lit("xz"), lit("bz"), lit("cz"), lit("rz"),
+ lit("res"),
nil
};
autoload_sys_set(al_struct, sys_sname, fun);