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


9.2 Function Declarations

Function declarations may be interspersed between function definition. A function declaration has a type, a name and a list of arguments, and it has no body.

integer sum(integer, integer);

Parameter names for function declarations are not used and may be omitted.

Function declarations and definitions of the same name must match in type and list of arguments.

Just like for function definitions, the function evaluation type may be omitted. And just like for function definitions, a function can not be called or otherwise referred until it acquires a type. Type omitted function pre-declarations are allowed and checked against latter definitions, but they are largely pointless.