summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2025-05-02 21:37:14 -0700
committerKaz Kylheku <kaz@kylheku.com>2025-05-02 21:37:14 -0700
commitc102c798213053d30ee9ba4ab0aefcf5d97f4634 (patch)
tree1bbbe46d4dc635dc0d8830bcb35ea931fcf1f04b /lib.h
parentc22c93cc8edeab9a16edd630a352d30b77650227 (diff)
downloadtxr-c102c798213053d30ee9ba4ab0aefcf5d97f4634.tar.gz
txr-c102c798213053d30ee9ba4ab0aefcf5d97f4634.tar.bz2
txr-c102c798213053d30ee9ba4ab0aefcf5d97f4634.zip
callf, juxt: rewrite.
* lib.[ch] (do_juxt, juxtv): Functions removed. * eval.c (do_callf): New static function. Implements callf without consing up an argument list with juxt which is then applied to the function. It's all done with a loop which builds args on the stack. (callf): Rewritten to use do_callf. We have to convert the function list to dynamic args, but that is more compact than all the consing done by the removed juxt implementation. (juxt): New static function: implemented trivially using callf and list_f. (eval_init): Change registration from removed juxtv to juxt. Going forward, I won't be using the v suffix on functions. That should only be used when two versions of a function exist: one which takes vargs, and one which takes C variable arguments or something else like a list. Example: format is a variadic C function with a ... in its argument list. formatv takes a varg and is the main implementation. vformat takes a va_list. Leading v is the standard C convention, like vsprintf. trailing v is the TXR convention for a function that takes vargs, but only if it is an alternative to one which doesn't.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/lib.h b/lib.h
index 848a8303..614263de 100644
--- a/lib.h
+++ b/lib.h
@@ -1286,7 +1286,6 @@ val pa_1234_34(val fun3, val arg1, val arg2);
val chain(val first_fun, ...);
val chainv(varg funlist);
val chandv(varg funlist);
-val juxtv(varg funlist);
val andf(val first_fun, ...);
val andv(varg funlist);
val orv(varg funlist);