summaryrefslogtreecommitdiffstats
path: root/combi.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-07-30 08:11:02 -0700
committerKaz Kylheku <kaz@kylheku.com>2024-07-30 08:11:02 -0700
commit147c1f0aad20859206c11c021d3ea065078941a4 (patch)
tree2bbe7c1956085599141847470bdbef7de04adc3f /combi.c
parent9e7cf279f3351b066d3a93402d6d43ef4c03f9bd (diff)
downloadtxr-147c1f0aad20859206c11c021d3ea065078941a4.tar.gz
txr-147c1f0aad20859206c11c021d3ea065078941a4.tar.bz2
txr-147c1f0aad20859206c11c021d3ea065078941a4.zip
keep-if, remove-if, keep-keys-if: mapfun argument.
We introduce a mapfun argument to these functions so that they can additionally transform the accumulated values. The keep-keys-if function is now implemented through the same helper function as keep-if but with the mapfun argument defaulting to a copy of the keyfun argument. * eval.c (eval_init): Update registrations of remove-if, keep-if and keep-keys-if to new arities of C functions. * lib.c (rem_if_impl): Implement new optional mapfun parameter. (remove_if, keep_if): Add mapfun parameter. (keep_keys_if): Implement via rem_if_impl, and add mapfun argument. We do the defaulting of keyfun here, so that we can then use that argument's value to default mapfun. * lib.h (remove_if, keep_if, keep_keys_if): Declarations updated. * tests/012/seq.tl: Couple of test cases exercising mapfun argument of keep-if and remove-if. * txr.1: Documented.
Diffstat (limited to 'combi.c')
0 files changed, 0 insertions, 0 deletions