Add function evaluation
This commit is contained in:
@@ -154,41 +154,6 @@ LISP_FUNC_0(ucl_builtin_now_millis_mono, state) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void ucl_print_obj(struct ucl_object *obj) {
|
||||
switch (obj->type) {
|
||||
case UCL_TYPE_SYMBOL:
|
||||
printf("%s", obj->symbol);
|
||||
break;
|
||||
case UCL_TYPE_INT:
|
||||
printf("%d", obj->integer);
|
||||
break;
|
||||
case UCL_TYPE_STRING:
|
||||
printf("\"%s\"", obj->string);
|
||||
break;
|
||||
case UCL_TYPE_ERROR:
|
||||
printf("(error \"%s\")", obj->error);
|
||||
break;
|
||||
case UCL_TYPE_BUILTIN:
|
||||
printf("<builtin %p>", obj->builtin);
|
||||
break;
|
||||
case UCL_TYPE_CELL: {
|
||||
int first = true;
|
||||
printf("%s", "(");
|
||||
FOREACH_LIST(obj, iter, item) {
|
||||
if (!first) {
|
||||
printf(" ");
|
||||
}
|
||||
ucl_print_obj(item);
|
||||
first = false;
|
||||
}
|
||||
printf("%s", ")");
|
||||
break;
|
||||
}
|
||||
case UCL_TYPE_COUNT:
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
|
||||
LISP_FUNC_1(ucl_builtin_print, state, arg0) {
|
||||
ucl_print_obj(arg0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user