在elisp中为什么要执行lambda工作,但应用它会引发错误?
ELISP> (funcall (lambda ()))
nil
ELISP> (apply (lambda ()))
*** Eval error *** Invalid function: lambda
答案 0 :(得分:3)
我的emacs给出了另一个错误:
*** Eval error *** Wrong number of arguments: apply, 1
我认为它解释了一切。
答案 1 :(得分:3)
必须给应用参数,参见(describe-function)结果:
apply is a built-in function in `C source code'.
(apply FUNCTION &rest ARGUMENTS)
Call FUNCTION with our remaining args, using our last arg as list of args.
Then return the value FUNCTION returns.
Thus, (apply '+ 1 2 '(3 4)) returns 10.
[back]