(describe-function apply)
says:
apply is a built-in function in ‘src/eval.c’.
(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.
(describe-function funcall)
says:
funcall is a built-in function in ‘src/eval.c’.
(funcall FUNCTION &rest ARGUMENTS)
Call first argument as a function, passing remaining arguments to it.
Return the value that function returns.
Thus, (funcall 'cons 'x 'y) returns (x . y).
What is the difference between these two function?
(apply #'+ 1 2 '(3 4))
is the same as(funcall #'+ 1 2 3 4)
. In other words,(funcall FN X Y Z)
is the same as(apply FN (list X Y Z))
.(apply #'FUNC ARGS)
where ARGS is an arbitrary list which has likely been supplied or generated by other code.