> Every variable in Chaos language is immutable by default. --- > kaos> num a = 5 > kaos> a = 7 > kaos> print a > 7 Doesn't that mean a is mutable by default?
No, it only means that you can reassign the name `a` to a different value (i.e. it is a variable, not a constant). It would be mutable if it allowed something like this: > a = 5 > a.add(1) > print a 6 Note that numbers are immutable in most languages anyway. Arrays, hashmaps, and sometimes strings are the data types that are frequently mutable.
But given that it's not an object oriented language, how could any variable be mutable given your example/definition?
How could you mutate a variable in a way that this language disallows?