Apply and read errors

This commit is contained in:
2026-09-05 07:05:12 -07:00
parent 4aeb7c0be5
commit 8ec08a55ea
10 changed files with 83 additions and 15 deletions
+16
View File
@@ -106,6 +106,22 @@ DEFUN(list, "list", (LispVal * args), "(&rest args)", "") {
return args;
}
DEFUN(list_star, "list*", (LispVal * arg, LispVal *args), "(arg &rest args)",
"") {
if (NILP(args)) {
return arg;
} else if (NILP(XCDR(args))) {
return CONS(arg, XCAR(args));
}
LispVal *out = CONS(arg, args);
args = out;
while (CONSP(args) && CONSP(XCDR(args)) && CONSP(XCDR(XCDR(args)))) {
args = XCDR(args);
}
RPLACD(args, XCAR(XCDR(args)));
return out;
}
DEFUN(copy_list, "copy-list", (LispVal * list), "(list)", "") {
LispVal *start = Qnil;
LispVal *end = NULL;