Previous section: Functional Operations

Dylan reference manual -- Function application

Function application

apply  function #rest args   =>  values	[Function]
apply calls function with args as the arguments. The last arg must be a sequence. The elements of the sequence are spread out and taken as individual arguments to function.
? apply(\+, #(1, 2))
3
? 1 + 2
3
? define constant math-functions = list (\+, \*, \/, \-))
? math-functions
#({generic +}, {generic *}, {generic /}, {generic -})
? first (math-functions)
{generic +}
? apply (first (math-functions), #(1, 2))
3

Next section: Identity function