-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.zs
More file actions
59 lines (48 loc) · 1.08 KB
/
test.zs
File metadata and controls
59 lines (48 loc) · 1.08 KB
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
52
53
54
55
56
57
58
59
module test;
function main() {
def variable = 9;
def $123 = "12345";
def foo = "zzzz";
writeln("hello from zeta-lang land");
writeln(2+2);
writeln(variable*8);
writeln($123[1]);
switch(foo) {
case "cat": writeln("cat");
case "flow": writeln("flow");
case "tart": writeln("tart");
case else: writeln("else");
}
def buffer = new:string();
for(def i = 0; i < 10; i++) {
buffer ~= cast:string(i);
buffer ~= " ";
}
with(buffer) {
writeln(length);
}
writeln(buffer);
if (variable >= 10) {
writeln("greater than or equal to 10");
} else {
writeln("less than 10");
}
//def tbl = new:table();
//tbl["test"] = true;
//writeln(tbl["test"]);
writeln(variable);
test(variable);
writeln(variable);
vargs(variable, 20, "string", [1 ,2 ,3] );
//def f = new:integer(5);
return 0;
}
function test(def arg) {
//arg += 1;
arg = 44;
writeln("arg:", arg);
}
function vargs(def $1st, def args...) {
writeln(args);
}
main();