Function Declarations
Functions are named global declarations, subject to the behavior described here.
Resultant Symbol
References to function declarations resolve to a function value.
Assertions
- Each parameter's type expression is a value of the type type.
- The return type's expression is a value of the type type.
- Each parameter's name is unique within the function.
Syntax
function_declaration_parameter = identifier, colon, expression ;
function_declaration_parameter_list = left_paren, [ function_declaration_parameter, { comma, function_declaration_parameter } ], right_paren ;
function_declaration = function, identifier, function_declaration_parameter_list, colon, expression, expression ;