Subroutine Declarations

We use fn to declare and define a subroutine/function.


fn main () ~> int {
	return 0;

In this Example, 'main' is the name of the subroutine, it takes no arguments, and the return type is 'int'.
The subroutine is impure, as indicated by '~>', which means it is allowed to have observable side effects.

Example 2

fn add (int a, int b) -> int {
	return a+b;

In this case, 'add' takes 2 arguments, and produces no side effects.