Builtin function argument parsing
This commit is contained in:
+12
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user