In elisp why does funcalling a lambda work, but applying it raises an error?
ELISP> (funcall (lambda ()))
nil
ELISP> (apply (lambda ()))
*** Eval error *** Invalid function: lambda
My emacs gives another error:
*** Eval error *** Wrong number of arguments: apply, 1
I think it explains everything.
Apply must be given arguments, see the (describe-function) result:
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]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With