funcall
funcall(slu_func[arg ...] ) =>g_result
Description
Applies the given function to the given arguments.
The first argument to funcall must be either the name of a function or a lambda/nlambda/macro expression or a function object. The rest of the arguments are to be passed to the function.
The arguments arg ...are bound to the formal arguments of s1u_func according to the type of function. For lambda functions the length of arg should match the number of formal arguments, unless keywords or optional arguments exist. For nlambda and macro functions, arg are bound directly to the single formal parameter of the function.
If s1u_func is a macro, funcall evaluates it only once, that is, it expands it and returns the expanded form, but does not evaluate the expanded form again (as eval does).
Arguments
Value Returned
Examples
funcall( 'plus 1 2 ) ; Apply plus to its arguments.
=> 3
procedure( sum3(x y z) funcall( 'plus x y z)
=> sum3 ;Define a procedure
sum3(1 2 3)
=> 6
Related Topics
Function and Program Structure
Return to top