runtime mutable global state

This commit is contained in:
2026-07-03 21:48:23 +02:00
parent adf142736c
commit ee41a54e41
11 changed files with 569 additions and 40 deletions
+3 -3
View File
@@ -44,11 +44,11 @@ main func() i32 {
total = total + 5 # 35
}
# block scoping: inner x shadows outer x, outer is unchanged after the block
# block scoping: inner bindings do not escape the block
x i32 = 1
if x == 1 {
x i32 = 100
if x == 100 {
inner_x i32 = 100
if inner_x == 100 {
total = total + 5 # 40
}
}