aboutsummaryrefslogtreecommitdiff
path: root/src/builtins.c
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-06-24 20:05:41 +0800
committerMistivia <i@mistivia.com>2025-06-24 20:05:41 +0800
commit7b50a2a3c6213d58f9e6a824e8d33c43f2dd9f60 (patch)
tree2cce2d023aeafff685368f78809f8640a11a73b1 /src/builtins.c
parenta19d0c8bc99948af39b43cc8291abfa89e5a57f8 (diff)
fix tailcall bug
Diffstat (limited to 'src/builtins.c')
-rw-r--r--src/builtins.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/builtins.c b/src/builtins.c
index d6db48a..68330d8 100644
--- a/src/builtins.c
+++ b/src/builtins.c
@@ -19,7 +19,7 @@ SExpRef builtin_map(Interp *interp, SExpRef args) {
for (SExpRef i = lst; !NILP(i); i = CDR(i)) {
SExpRef x = CAR(i);
PUSH_REG(newlst);
- SExpRef newx = lisp_apply(interp, fn, CONS(x, NIL), false);
+ SExpRef newx = lisp_call(interp, fn, CONS(x, NIL));
POP_REG();
if (CTL_FL(newx)) return newx;
newlst = CONS(newx, newlst);
@@ -40,7 +40,7 @@ SExpRef builtin_filter(Interp *interp, SExpRef args) {
for (SExpRef i = lst; !NILP(i); i = CDR(i)) {
SExpRef x = CAR(i);
PUSH_REG(newlst);
- SExpRef pred = lisp_apply(interp, fn, CONS(x, NIL), false);
+ SExpRef pred = lisp_call(interp, fn, CONS(x, NIL));
POP_REG();
if (CTL_FL(pred)) return pred;
if (TRUEP(pred)) {
@@ -63,7 +63,7 @@ SExpRef builtin_remove(Interp *interp, SExpRef args) {
for (SExpRef i = lst; !NILP(i); i = CDR(i)) {
SExpRef x = CAR(i);
PUSH_REG(newlst);
- SExpRef pred = lisp_apply(interp, fn, CONS(x, NIL), false);
+ SExpRef pred = lisp_call(interp, fn, CONS(x, NIL));
POP_REG();
if (CTL_FL(pred)) return pred;
if (!TRUEP(pred)) {
@@ -85,7 +85,7 @@ SExpRef builtin_count(Interp *interp, SExpRef args) {
int count = 0;
for (SExpRef i = lst; !NILP(i); i = CDR(i)) {
SExpRef x = CAR(i);
- SExpRef pred = lisp_apply(interp, fn, CONS(x, NIL), false);
+ SExpRef pred = lisp_call(interp, fn, CONS(x, NIL));
if (CTL_FL(pred)) return pred;
if (TRUEP(pred)) {
count++;
@@ -105,7 +105,7 @@ SExpRef builtin_foreach(Interp *interp, SExpRef args) {
}
for (SExpRef i = lst; !NILP(i); i = CDR(i)) {
SExpRef x = CAR(i);
- SExpRef newx = lisp_apply(interp, fn, CONS(x, NIL), false);
+ SExpRef newx = lisp_call(interp, fn, CONS(x, NIL));
if (CTL_FL(newx)) return newx;
}
return NIL;