summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-01-24 22:22:27 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-01-24 22:22:27 -0800
commit6c9893d4790f1a27c900b2d84a3532ae7c402463 (patch)
treeebe02f2214fde29154735f1ef2e9372a15772377 /eval.c
parentc12e24f335c4b37d9abc24f387dc1e06de1058df (diff)
downloadtxr-6c9893d4790f1a27c900b2d84a3532ae7c402463.tar.gz
txr-6c9893d4790f1a27c900b2d84a3532ae7c402463.tar.bz2
txr-6c9893d4790f1a27c900b2d84a3532ae7c402463.zip
* eval.c (callf): New static function.
(eval_init): callf registered. * txr.1: Documented callf.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index bba8be6e..de125ea0 100644
--- a/eval.c
+++ b/eval.c
@@ -3455,6 +3455,13 @@ static val ipf(val fun)
return func_f0v(fun, do_ipf);
}
+static val callf(val func, val funlist)
+{
+ val juxt_fun = juxtv(funlist);
+ val apf_fun = apf(func);
+ return chain(juxt_fun, apf_fun, nao);
+}
+
static val prinl(val obj, val stream)
{
val ret = obj_print(obj, stream);
@@ -3902,6 +3909,7 @@ void eval_init(void)
reg_fun(intern(lit("retf"), user_package), func_n1(retf));
reg_fun(apf_s, func_n1(apf));
reg_fun(ipf_s, func_n1(ipf));
+ reg_fun(intern(lit("callf"), user_package), func_n1v(callf));
reg_fun(intern(lit("tf"), user_package), func_n0v(tf));
reg_fun(intern(lit("nilf"), user_package), func_n0v(nilf));