-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path037.fun
More file actions
47 lines (44 loc) · 665 Bytes
/
037.fun
File metadata and controls
47 lines (44 loc) · 665 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
# testing name collisions
fun text() {
return 1
}
fun data() {
return 2
}
fun global() {
return 3
}
fun start() {
start = 2
return start
}
fun format(rdi, rsi) {
return rdi + rsi
}
# testing more name collisions with recursion
fun wow(wow) {
if (wow == 0) {
return 10
} else {
return wow(wow - 1) + 1
}
}
# test copy by value
fun modifyme(myreg) {
myreg = 4
}
fun main() {
format = 4
# 2
print(start())
# 3
myreg = global()
modifyme(myreg)
print(myreg)
# 5
print(text() + format(start(), data()))
# 12
print(format(format(format, format), format))
# 14
print(wow(format))
}