2022-07-03 23:13:12 +02:00
|
|
|
print("hello".eq("world"));
|
2022-07-03 23:45:34 +02:00
|
|
|
|
2022-07-03 23:13:12 +02:00
|
|
|
print((40 + 2).is_42() == true);
|
2022-07-03 23:45:34 +02:00
|
|
|
|
|
|
|
let y = 0;
|
|
|
|
|
|
|
|
def test_func(x) {
|
|
|
|
print(x);
|
|
|
|
while x < 100 {
|
|
|
|
print(x);
|
|
|
|
x = x + 1;
|
2022-07-04 15:36:03 +02:00
|
|
|
if x > 10 {
|
|
|
|
return "bar";
|
|
|
|
}
|
2022-07-03 23:45:34 +02:00
|
|
|
}
|
2022-07-04 15:36:03 +02:00
|
|
|
return "foo";
|
2022-07-03 23:45:34 +02:00
|
|
|
}
|
|
|
|
|
2022-07-04 15:36:03 +02:00
|
|
|
def add_one(x) {
|
|
|
|
x + 1
|
|
|
|
}
|
|
|
|
|
|
|
|
let x = test_func(y);
|
|
|
|
print(x);
|
|
|
|
|
|
|
|
print(add_one(41));
|
2022-07-03 23:45:34 +02:00
|
|
|
|
2022-07-04 21:49:08 +02:00
|
|
|
let x = 0;
|
|
|
|
if x == 0 {
|
|
|
|
x = x + 10;
|
|
|
|
}
|
|
|
|
print(x);
|
|
|
|
|
|
|
|
let x = 5;
|
2022-07-04 22:23:59 +02:00
|
|
|
print(if x < 10 { 20 } else { 30 });
|
|
|
|
|
|
|
|
let f1 = native_test();
|
|
|
|
let f2 = other_foo();
|
|
|
|
|
|
|
|
let f3 = f1 + f2;
|
|
|
|
|
|
|
|
print(f3);
|