You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it's easy to overwrite existing variables by accident, due to all assignments mutating the outermost variable. Instead of this, I think that by default creating a new variable each time would make more sense, with an optional mut keyword that makes a variable mutable, and prevents further declarations from shadowing existing ones:
x = 1
do
x = 2
assert(x == 2)
end
assert(x == 1)
mut i = 1
while i <= 10 do
i = i + 1
end
The text was updated successfully, but these errors were encountered:
Currently it's easy to overwrite existing variables by accident, due to all assignments mutating the outermost variable. Instead of this, I think that by default creating a new variable each time would make more sense, with an optional
mut
keyword that makes a variable mutable, and prevents further declarations from shadowing existing ones:The text was updated successfully, but these errors were encountered: