Function object represents an implementation of some function. There are differend kinds of function providers.

Function object defines:

Lexical Context

Function known it's lexical scope (context). It is assigned when parsing the function (module).

When activating the function, new context containing function arguments and it's lexical context is created.

Dynamic context

Arguments specified in function call create dynamic context. Dynamic context may be specified to eval function.

Function interface

Following interface is implemented by function providers.

void FuncFree(Function * func)

Free all provider specific resources allocated for the function.

Error FuncEval(ActivationRecord ** p_act)

Evaluate the function using specified activation record stack.

Type FuncArgType(Function * func)

Return type of function argument.

Type FuncResultType(Function * func)

Return type of the function result.

Bool FuncIsConst(Function * func)

Returns true, if this is const function.