![[LISPWORKS]](/image.pl?url=http%3a%2f%2fwww.lispworks.com%2fdocumentation%2fHyperSpec%2fBody%2f..%2fGraphics%2fLWSmall.gif&f=jpg&w=240)
![[Common Lisp HyperSpec (TM)]](/image.pl?url=http%3a%2f%2fwww.lispworks.com%2fdocumentation%2fHyperSpec%2fBody%2f..%2fGraphics%2fCLHS_Sm.gif&f=jpg&w=240)
Syntax:
funcallfunction&rest args =>result*
Arguments and Values:
function---afunction designator.
args---arguments to thefunction.
results---thevalues returned by thefunction.
Description:
funcall appliesfunction toargs. Iffunction is asymbol, it is coerced to afunction as if by finding itsfunctional value in theglobal environment.
Examples:
(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)
Affected By: None.
Exceptional Situations:
An error oftypeundefined-function should be signaled iffunction is asymbol that does not have a global definition as afunction or that has a global definition as amacro or aspecial operator.
See Also:
apply,function,Section 3.1 (Evaluation)
Notes:
(funcall function arg1 arg2 ...) == (apply function arg1 arg2 ... nil) == (apply function (list arg1 arg2 ...))
The difference betweenfuncall and an ordinary function call is that in the former case thefunction is obtained by ordinaryevaluation of aform, and in the latter case it is obtained by the special interpretation of the function position that normally occurs.