Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

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

slu_func

Name of the function.

arg

Arguments to be passed to the function.

Value Returned

g_result

The result of applying the function to the given arguments.

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
 ⠀
X