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