ona/debug/app.ona

40 lines
468 B
Plaintext
Raw Normal View History

2023-05-23 23:22:29 +00:00
2023-11-04 11:30:45 +00:00
let printer = lambda (pfx):
let prefix = pfx
return lambda (msg):
2023-11-04 11:30:45 +00:00
@print(prefix)
@print(msg)
end
2023-08-26 16:00:17 +01:00
end
2023-11-04 11:30:45 +00:00
let pr = printer("This is a func call")
var i = 0
2023-10-29 21:48:21 +00:00
pr("test")
2023-08-24 23:45:29 +01:00
while i < 5:
2023-08-26 16:00:17 +01:00
pr("hello, world")
2023-08-13 02:03:43 +01:00
2023-08-22 23:49:23 +01:00
i = i + 1
end
2023-08-24 23:45:29 +01:00
if i > 6:
2023-08-26 16:00:17 +01:00
pr("`i` greater than `6`")
2023-08-24 23:45:29 +01:00
elif i == 4:
2023-08-26 16:00:17 +01:00
pr("`i` is equal to `4`")
2023-08-24 23:45:29 +01:00
else:
2023-08-26 16:00:17 +01:00
pr("i'unno")
2023-08-24 23:45:29 +01:00
end
2023-11-04 11:30:45 +00:00
let pr2 = printer("this is a final closure")
pr2("goodbye")
2023-08-22 23:49:23 +01:00
return {
.title = "Game",
.width = 1280,
.height = 800,
.tick_rate = 60,
2023-05-23 23:22:29 +00:00
}