-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-5.cl
61 lines (50 loc) · 1.64 KB
/
test-5.cl
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
60
61
Class Main inherits IO{
main(): Object {
let something: String, turtle: Int in {
let something: Something <- new Something in {
out_string(something.f().type_name());
};
out_string(something.type_name());
something.concat(something);
out_string(something);
turtle <- 2147483647;
out_int(turtle);
let x:Int <- 7, y:Int<-9, z:Int<-7 in {
-- check some math stuff?
if (9<7) then out_string("true")
else out_string("false") fi;
if (7<9) then out_string("true")
else out_string("false") fi;
if (7=9) then out_string("true")
else out_string("false") fi;
if (7=x) then out_string("true")
else out_string("false") fi;
if (7<=9) then out_string("true")
else out_string("false") fi;
if (7<=y) then out_string("true")
else out_string("false") fi;
if (x<=z) then out_string("true")
else out_string("false") fi;
if (x<=x) then out_string("true")
else out_string("false") fi;
if (9<=7) then out_string("true")
else out_string("false") fi;
};
abort();
out_string("This should be unreachable");
}
};
};
Class Something {
f() : Something {
self
};
init(): Something {
self.f()
};
};
Class Teeth inherits Something {
questionableChoice() : Something {
self
};
};