slige/examples/example_1.slg

33 lines
434 B
Plaintext

fn print(msg: string) #[builtin(Print)] {}
fn sum(a: int, b: int) -> int {
a + b
}
fn main() {
sum(2,3); // -> 5
let a: string = "Hello";
let b = "world";
print(a + " " + b + "!\n"); // -> "Hello world!"
if a == b {
print("whaaaat\n");
}
else {
print(":o\n");
}
loop {
let i = 0;
if i >= 10 {
break;
}
i = i + 1;
}
}