Apply

The function (apply fn args) can be used to execute (apply) the function fn on arguments args.


> (define nums '(3 7 8))
nums

> (apply + nums) 18

> (apply * nums) 168

> (apply < nums) #t

apply is useful if the existing form of the data is a list of arguments; it saves a cons that would be required to make a function call for eval.

Contents    Page-10    Prev    Next    Page+10    Index