Apply and read errors
This commit is contained in:
+16
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user