slige/compiler/example-no-types.slg

29 lines
280 B
Plaintext
Raw Normal View History

2024-11-18 09:21:30 +00:00
2024-11-26 18:37:21 +00:00
fn sum(a, b) {
+ a b;
}
2024-12-06 11:21:57 +00:00
sum(2,3); // -> 5
2024-11-26 18:37:21 +00:00
let a = "Hello";
let b = "world";
2024-11-18 09:21:30 +00:00
2024-11-21 13:38:33 +00:00
println(+ + + a " " b "!"); // -> "Hello world!"
2024-11-20 14:41:20 +00:00
if == a b {
println("whaaaat");
}
else {
println(":o");
2024-11-18 09:21:30 +00:00
}
2024-11-20 14:41:20 +00:00
loop {
2024-11-21 13:38:33 +00:00
let i = 0;
if >= i 10 {
break;
}
i = + i 1;
2024-11-20 14:41:20 +00:00
}