next up previous
Contents Next: atom (PREDICATE) Up: Appendix: Selected LISP Previous: append (FUNCTION)

apply (FUNCTION)

Format: (apply <func> <list>) (apply <func> <exp1> ... <expn> <list>)

Required arguments: 2

<func> must name a function or predicate (usually quoted); the last argument must be a list.

Optional arguments: arbitrary

Intermediate argument expressions must evaluate to items of the correct type to which <func> can be applied

Examples:

>(apply '+ '(1 2 3 4))
10

>(apply '+ 1 2 '(3 4))
10



© Colin Allen & Maneesh Dhagat
November 1999