next up previous
Contents Next: Apply Up: FunctionsLambda Expressions, Previous: Lambda Expressions

Funcall

[Our thanks to John H. Remmers for allowing his material from his programming languages course to be incorporated into this section.]

FUNCALL is similar to APPLY, except that the function arguments are at the same level as the function description instead of being in a sublist, as APPLY is typically used. For example:

> (FUNCALL '+ 3 5 9)
17
In fact, the similarity is closer than this description indicates for
(FUNCALL '+ 1 2 3)
not only evaluates to the same result as
(APPLY '+ '(1 2 3))
but also to the same result as
(APPLY '+ 1 2 3 nil)


© Colin Allen, John H. Remmers, & Maneesh Dhagat
November 1999