diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-03-22 18:50:40 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-03-22 18:50:40 -0700 |
commit | 2a8b1e4388daa00005cbc1e25913479075507ab2 (patch) | |
tree | 8804f6c4dc3b7d8f4888fe92e5fe559bb30cebb5 /txr.1 | |
parent | 24bfded1413e45bb949f6c1ee2b3e8ef34f12329 (diff) | |
download | txr-2a8b1e4388daa00005cbc1e25913479075507ab2.tar.gz txr-2a8b1e4388daa00005cbc1e25913479075507ab2.tar.bz2 txr-2a8b1e4388daa00005cbc1e25913479075507ab2.zip |
apf and ipf: take arguments that are inserted.
The apf and ipf functions now take arguments in addition to
the function that is being wrapped. If specified, these
arguments are inserted to the left the applied arguments.
* eval.c (do_args_apf, do_args_ipf): New static functions.
(apf, ipf): Use do_args_apf and do_args_ipf, respectively,
for handling the case when arguments are present.
Passing the stored arguments is done with the help of the new
DARG type, instead of consing up a list.
* txr.1: Documented new arguments of apf and ipf.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -47974,8 +47974,8 @@ macro. .coNP Functions @ apf and @ ipf .synb -.mets (apf << function ) -.mets (ipf << function ) +.mets (apf < function << arg *) +.mets (ipf < function << arg *) .syne .desc The @@ -47992,6 +47992,18 @@ It then returns whatever .meta function returns. +If one or more additional +.metn arg -s +are passed to +.codn apf , +then these are stored in the function which is returned. +When the function is invoked, it prepends all of these stored +arguments to those that it is being given, and the resulting combined +arguments are applied. Thus the +.metn arg -s +become the leftmost arguments of +.metn function . + The .code ipf function is similar to |