funcall
funcall function &rest args → {result}*
function—a function designator.
args—arguments to the function.
7.9.2 5results—the values returned by the function.
7.3.0 3funcall applies function to args. !!! Barmar: "a symbol" => "a function name"If function is a symbol, it is coerced to a function as if by !!! Barmar: => "... as if fdefinition."finding its functional value in the global environment.
(funcall #'+ 1 2 3) → 6
(funcall 'car '(1 2 3)) → 1
(funcall 'position 1 '(1 2 3 2 1) :start 1) → 4
(cons 1 2) → (1 . 2)
(flet ((cons (x y) `(kons ,x ,y)))
(let ((cons (symbol-function '+)))
(funcall #'cons
(funcall 'cons 1 2)
(funcall cons 1 2))))
→ (KONS (1 . 2) 3)
None.
An error of type undefined-function should be signaled if function is a symbol that does not have a global definition as a function or that has a global definition as a macro or a special operator.
apply, function, Section 3.1 (Evaluation)
(funcall function arg1 arg2 ...) ≡ (apply function arg1 arg2 ... nil) ≡ (apply function (list arg1 arg2 ...))
The difference between funcall and an ordinary function call is that in the former case the function is obtained by ordinary evaluation of a form, and in the latter case it is obtained by the special interpretation of the function position that normally occurs.