diff options
| author | Mistivia <i@mistivia.com> | 2025-06-22 15:48:01 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-06-22 15:48:01 +0800 |
| commit | b19a0b2ea246be5610812bf7dd4088e0c4a70952 (patch) | |
| tree | fee7d6545d9073a1ab9d943fda0d0804e54237a8 /src/interp.c | |
| parent | 9991238f133f2cb06ee366b2c92dbb32a126ae9d (diff) | |
eq, equal
Diffstat (limited to 'src/interp.c')
| -rw-r--r-- | src/interp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/interp.c b/src/interp.c index f055bce..d7e06ed 100644 --- a/src/interp.c +++ b/src/interp.c @@ -86,6 +86,8 @@ void Interp_init(Interp *self) { Interp_add_primitive(self, "assert-error", primitive_assert_error); Interp_add_primitive(self, "load", primitive_load); + Interp_add_userfunc(self, "eq", builtin_eq); + Interp_add_userfunc(self, "equal", builtin_equal); Interp_add_userfunc(self, "format", builtin_format); Interp_add_userfunc(self, "concat", builtin_concat); Interp_add_userfunc(self, "error", builtin_error); @@ -627,8 +629,10 @@ SExpRef lisp_apply(Interp *interp, SExpRef fn, SExpRef args, bool istail) { iter = CDR(iter); } } else if (VALTYPE(fn) == kUserFuncSExp) { - LispUserFunc fnptr = REF(fn)->userfunc; + LispUserFunc fnptr = REF(fn)->userfunc; + PUSH_REG(args); ret = (*fnptr)(interp, args); + POP_REG(); return ret; } end: |
