Next: , Previous: , Up: Functions   [Contents][Index]


5.9.6 Calling Functions

Most of the time function applications are made by the evaluator when it finds a functional value after evaluating the first element of a list form. However two functions are available for manually calling functions.

Function: funcall function #!rest args

Applies the argument values args to the function function, then returns its result.

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.

(apply + 1 '(2 3))
    ⇒ 6

(apply + (make-list 1000000 1))
    ⇒ 1000000