aboutsummaryrefslogtreecommitdiff
path: root/examples/v2.halk
blob: 1d35efd579803150bf5749459fedca6c1d8cd190 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
` new syntax `

#include."IO.halk";           ` preprocessor directives start with '#' and end with ';' `
#macro."PI","3.14159";        ` replace every instance of PI with 3.14159 `


` mut:?<some type>:<some name> = <some value>; `

str:hello = "Hello";          ` by default, variables are immutable `
mut:str:world = "world"       ` one can create an immutable variable with mut: `

void:say_hello.str:to = {     ` functions need no special keyword `
   io.stdout.to;        
}

int:main.str[]:args = {       ` start executing here `
   return.0;
}