aboutsummaryrefslogtreecommitdiff
path: root/recurse.hgn
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2025-07-30 16:30:48 +0200
committerMathias Magnusson <mathias@magnusson.space>2025-07-30 16:30:48 +0200
commit69ecbca927d963311469f4634c002553d0c99bd4 (patch)
treec241e07e6c8238057d4d04b987cb393894382ebf /recurse.hgn
parent132a8da9a41a6303d40c8ec936a31c9481581cbe (diff)
downloadhuginn-69ecbca927d963311469f4634c002553d0c99bd4.tar.gz
implement return expressions
Diffstat (limited to 'recurse.hgn')
-rw-r--r--recurse.hgn11
1 files changed, 11 insertions, 0 deletions
diff --git a/recurse.hgn b/recurse.hgn
new file mode 100644
index 0000000..52b7da4
--- /dev/null
+++ b/recurse.hgn
@@ -0,0 +1,11 @@
+main := proc() {
+ print_up_to(10)
+ exit(0)
+}
+
+print_up_to := proc(n) {
+ print(n)
+ if n > 0 {
+ print_up_to(n - 1)
+ }
+}