Allow calling lambdas directly
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
;; -*- mode: lisp-data -*-
|
||||
|
||||
(print (funcall (let ((te 'a))
|
||||
(lambda (b &optional (a te ap)) a)) 2 3))
|
||||
(print ((lambda (a) a) 1))
|
||||
|
||||
@ -477,6 +477,8 @@ DEFUN(funcall, "funcall", (LispVal * func, LispVal *args), "(func &rest args)",
|
||||
LispFunction *fobj = func;
|
||||
if (SYMBOLP(func)) {
|
||||
fobj = Fsymbol_function(func, Qt);
|
||||
} else if (CONSP(func) && EQ(XCAR(func), Qlambda)) {
|
||||
fobj = Feval(func, TOP_LEXENV());
|
||||
}
|
||||
// include symbol here for the error message
|
||||
CHECK_TYPE(fobj, TYPE_FUNCTION, TYPE_SYMBOL);
|
||||
|
||||
Reference in New Issue
Block a user