Apply and read errors
This commit is contained in:
+12
-1
@@ -485,6 +485,14 @@ DEFUN(funcall, "funcall", (LispVal * func, LispVal *args), "(func &rest args)",
|
||||
return UNWIND_AND_RETURN(stack_ref, raw_funcall(res, args));
|
||||
}
|
||||
|
||||
DEFUN(apply, "apply", (LispVal * func, LispVal *args), "(func &rest args)",
|
||||
"") {
|
||||
if (NILP(args)) {
|
||||
return CALL0(func);
|
||||
}
|
||||
return Ffuncall(func, Flist_star(XCAR(args), XCDR(args)));
|
||||
}
|
||||
|
||||
static LispVal *parse_lambda_declare_form(LispFunction *fobj, LispVal *body) {
|
||||
while (CONSP(body) && CONSP(XCAR(body)) && EQ(XCAR(XCAR(body)), Qdeclare)) {
|
||||
LispVal *decls = XCDR(XCAR(body));
|
||||
@@ -588,7 +596,10 @@ DEFUN(special_form_p, "special-form-p", (LispVal * val), "(val)", "") {
|
||||
return builtin_function_p(val, true) ? Qt : Qnil;
|
||||
}
|
||||
|
||||
DEFINE_SYMBOL(declare, "declare");
|
||||
DEFSPECIAL(declare, "declare", (LispVal * forms), "(&rest forms)", "") {
|
||||
lisp_signal(Qerror,
|
||||
LIST(LISP_LITSTR("(declare ...) form in invalid position")));
|
||||
}
|
||||
DEFINE_SYMBOL(name, "name");
|
||||
|
||||
DEFINE_SYMBOL(callable, "callable");
|
||||
|
||||
Reference in New Issue
Block a user