-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsyntax_example.txt
More file actions
50 lines (42 loc) · 978 Bytes
/
syntax_example.txt
File metadata and controls
50 lines (42 loc) · 978 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
types:
boolean -> True, False, Null
integer -> all integers
rational -> all rational numbers
string -> text
set -> a group of values, cannot contain any value more than once
array -> a group of values
map -> a group of key value Parenthesis
structure -> a group of indentifier value pairs
block -> ()
define method add = rational a, rational b -> {
define rational sum = a + b;
} -> rational sum;
define sum = add(#3.14, #1.0);
output(sum) // 4.14
run create_class with #3.14 on instance;
instance.add()
// dynamic
define a; let a = 'Hello world';
let a = #3.14;
// function
function func = {
take integer a; take integer b;
return integer sum;
sum = a + b;
end;
};
any result = func(#1, #2);
// if statement
if True then {
print('It was true.');
} else {
print('It was false');
};
// for loop
for i in <#4, #3, #2, #1, #0> do {
print(i);
};
// while loop
while True do {
print('Hello world!');
};