runtime mutable global state
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user