Next: , Previous: , Up: Functions   [Index]


3.4.8 Variadic Functions

Variadic functions are functions of indefinite arity, i.e. accepting a variable number of arguments. Much like in C, the first arguments are named and typed, while the additional (unnamed) arguments may come in any number and type.

Since the expression evaluator delivers the function arguments as an array, the delivery of the values of the unnamed arguments does not stretch the function call interface much. The delivery of their number and types does, though.

A function description in the struct x1f4_function_type definition indicating the number of arguments and their types is presented to the C routine supporting the the symbolic function as part of the extended execution context.

See Extended Execution Context.

See Extended Execution Context Definitions.

This function description covers in its list of arguments part the pass by type (value or reference), if pass by reference is required by one of X1f4_E4_POST_TYPE and X1f4_E4_LINK_PASS in the original function description. The (pass by) type is copied from the latter for the mandatory arguments and set appropriately for the variadic arguments.

The variadic function definitions are introduced as the rest of function definitions and include the X1f4_E4_SIDE_LIST bit in their flag bits.

See Function Flags.

See struct x1f4_function_type.

The argument count and types in their struct x1f4_function_type definition refer the initial mandatory arguments.

The X1f4_E4_SIDE_LIST bit is not set for the struct x1f4_function_type function definition describing the arguments list.