slige/examples/example_1.slg
2024-12-11 12:36:19 +01:00

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;
}
}