-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathlambda.ai
More file actions
51 lines (43 loc) · 668 Bytes
/
lambda.ai
File metadata and controls
51 lines (43 loc) · 668 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
let x = 2;
if x > 10 {
print("big");
} else if x > 5 {
print("medium");
} else {
print("small");
}
let obj = {x: 1, y: 2};
print(obj);
if true {
print(true);
}
if true {
"ok";
} else {
fn foo() {}
}
print({arr:[1]} == [{"x":1}]);
if 0 { print(0); }
while x > 0 {
print(x);
x = x - 1;
}
while len([1,2,3]) > 0 { // Error due to in_flow_condition check
// ...
print("yes");
break;
}
// Basic for loop
for let i = 0; i < 10; i = i + 1 {
print(i);
}
let i = 8;
// Loop without initializer
for ; i < 10; i = i + 1 {
print(i);
}
// Loop without increment
for let i = 0; i < 10; {
print(i);
i = i + 1;
}