Lipi Reference Lipi

Keywords

func

The other spelling for opening a function declaration. It declares exactly what `def` declares. A body is either a braced block or a single expression after an arrow, and the arrow form also accepts a tuple, which is how a function returns more than one value.

Syntax

                func <function_name>(<data_type> <param_name> [= <default_value>], ...) {
	<function_body>
}
		
func <function_name>(<data_type> <param_name> [= <default_value>], ...) => <expression>