chancehudson / ashlang

Apache License 2.0
6 stars 2 forks source link

Variables dimensions should match during re-assignment #53

Open chancehudson opened 1 week ago

chancehudson commented 1 week ago

Once a variable is defined the dimensions of the variable should not be able to change. Right now the following code compiles:

let x = [1, 2, 3]
assert_eq(x[0], 1)
assert_eq(x[1], 2)
assert_eq(x[2], 3)

x = 5
assert_eq(x, 5)

Technically it's not complex to manage changing dimensions. It seems like a footgun to expose this capability as a feature of the language though.