Go to the first, previous, next, last section, table of contents.


Calling Functions

Most of the time function calls are done by the evaluator when it detects a function call form (see section List Forms); when the function to be called is not known until run-time it is easier to use a special function to call the function directly than create a custom form to apply to the eval function.

Function: funcall function &rest args
Applies the argument values args to the function function, then returns its result.

Note that the argument values args are not evaluated again. This also means that funcall can not be used to call macros or special forms -- they would need the unevaluated versions of args, which are not available to funcall.

(funcall '+ 1 2 3)
    => 6

Function: apply function &rest args
Similar to funcall except that the last of its arguments is a list of arguments which are appended to the other members of args to form the list of argument values to apply to the function function.

Constructs a list of arguments to apply to the function function from args.


Go to the first, previous, next, last section, table of contents.