Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
funcall vs在elisp中应用lambda_Lambda_Elisp_Function Pointers - Fatal编程技术网

funcall vs在elisp中应用lambda

funcall vs在elisp中应用lambda,lambda,elisp,function-pointers,Lambda,Elisp,Function Pointers,在elisp中,为什么函数化lambda有效,但应用它会引发错误 ELISP> (funcall (lambda ())) nil ELISP> (apply (lambda ())) *** Eval error *** Invalid function: lambda 我的emacs给出了另一个错误: *** Eval error *** Wrong number of arguments: apply, 1 我认为它解释了一切。必须为Apply提供参数,请参见(描述函数

在elisp中,为什么函数化lambda有效,但应用它会引发错误

ELISP> (funcall (lambda ()))
nil
ELISP> (apply (lambda ()))
*** Eval error ***  Invalid function: lambda

我的emacs给出了另一个错误:

*** Eval error ***  Wrong number of arguments: apply, 1

我认为它解释了一切。

必须为Apply提供参数,请参见(描述函数)结果:

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]