aboutsummaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-06-24 05:36:48 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-06-24 05:39:22 +0200
commit28270d80af2fa090694359f84ec2b9cadee77995 (patch)
treedd0232b891e68be6e8f53cf43f22f657f424e208 /README
parent578a597b942eaf3c79854b09062001f6fc169abb (diff)
Support nested functions
Diffstat (limited to 'README')
-rw-r--r--README14
1 files changed, 14 insertions, 0 deletions
diff --git a/README b/README
index 91b3fb6..473146c 100644
--- a/README
+++ b/README
@@ -61,3 +61,17 @@ Portuguese or ‘Όρυξ’ in Greek) as opposed to using the English name.
x: int = 69;
y: i64 = x; /* Compile-time error */
}
+
+7. Nested functions are supported, but not closures. Closures will
+ never be supported in the language.
+
+ /* Recall that constants (including functions!) can be declared
+ in any order. This lets us define Inner *after* it gets
+ called by the assignment to ‘x’. */
+ Outer :: () {
+ x := Inner(5);
+
+ Inner :: (x: int) int {
+ return x;
+ }
+ }