Builtin function argument parsing

This commit is contained in:
2026-01-19 23:29:14 -08:00
parent c63b104bc6
commit 243a012d3e
11 changed files with 243 additions and 50 deletions
+12 -3
View File
@@ -3,15 +3,24 @@
#include <stdio.h>
DEFUN(cool_func, "cool-func", (LispVal * a, LispVal *b), "(a &optional b)",
"") {
printf("A: ");
debug_obj_info(stdout, a);
printf("B: ");
debug_obj_info(stdout, b);
return Qnil;
}
int main(int argc, const char **argv) {
lisp_init();
REGISTER_GLOBAL_FUNCTION(cool_func);
push_stack_frame(Qnil, Qnil, Qnil);
ReadStream s;
const char BUF[] = "(a b c d e f g h i j k l m)";
const char BUF[] = "()";
read_stream_init(&s, BUF, sizeof(BUF) - 1);
LispVal *l = read(&s);
l = Ffuncall(Qmake_symbol, LISP_LITSTR("a"));
debug_obj_info(stdout, l);
Ffuncall(Qcool_func, l);
pop_stack_frame();
lisp_shutdown();
return 0;